1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-30 21:55:24 +00:00
Commit Graph

162 Commits

Author SHA1 Message Date
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Michael Vetter
c8b2979dcd Exit *_incoming_msg functions when plain message is empty
Fix https://github.com/profanity-im/profanity/issues/1733
2022-07-04 16:58:16 +02:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
MarcoPolo-PasTonMolo
03f8db9658 Add none option for /who
Fixes https://github.com/profanity-im/profanity/issues/1425
`/who none` now displays all users in an muc without an affiliation
2022-03-27 16:06:29 +03:00
MarcoPolo-PasTonMolo
06ef6842e8 Add quote autocompletion for previous messages
Fixes https://github.com/profanity-im/profanity/issues/1649

Type `>` then press tab or shift tab to autocomplete previous messages,
then type your reply and send message.
Newlines are replaced with newline followed by `> `.
A newline is added at the end so that the user can immediately type a
message without manually adding a new line.
2022-03-21 13:46:50 +02:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Dmitry Podgorny
c0ea27f2f0 Don't handle /me in the middle of a message with mentions 2021-07-17 19:36:31 +03:00
Dmitry Podgorny
a5d15e224c Fix buffer overread in _mucwin_print_mention()
Offset for g_utf8_substring() is higher than the string length. We can
avoid g_utf8_substring() for the tail and simply convert starting offset
to a pointer.
2021-07-17 19:33:28 +03:00
Michael Vetter
f20f629bb4 Fix multiple mentions in one line
`jubalh: jubalh jubalh` resulted in `20:32:34 - testuser1:
jubalh20:32:34 - testuser1: :  jubalh20:32:34
- testuser1:  jubalh`

Print date/nick only once at beginning of line.
2021-06-08 20:34:24 +02:00
Michael Vetter
6bc440c6f7 Use utf-8 safe functions in _mucwin_print_mention()
get_mentions() correctly counts utf-8 chars. So the positions of
mentions we get from there are correct.

But in _mucwin_print_mention() we set position equal to byte.
We need to use utf-8 safe functions here.

Regards https://github.com/profanity-im/profanity/issues/1231
2021-06-08 19:42:41 +02:00
Michael Vetter
1ec606540e Get rid of asprintf and _GNU_SOURCE define
_GNU_SOURCE was even in some files where it was not needed at all
(http*).

Let's replace asprintf() with g_strdup_printf().
2021-03-30 17:38:13 +02:00
Michael Vetter
057c9ad776 Add config.h in files were it was missing
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Thorben Günther
f1780f0017
MUC: Show offline members in sidebar 2021-03-08 14:34:59 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
Michael Vetter
a94378f206 Fix various typos 2020-12-10 09:24:32 +01:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
DebXWoody
2c94ee5a88 Feature request - XEP-0373: OpenPGP for XMPP (OX)
Basic implementation of XEP-0373: OpenPGP for XMPP.
https://xmpp.org/extensions/xep-0373.html

Command /ox

Issue: #1331
2020-06-29 19:05:41 +02:00
Michael Vetter
ce32d874e0 Build URL ac upon printing of message in window 2020-05-20 10:54:54 +02:00
Michael Vetter
85520ecdc5 Remove unanimous MAM display
For some time users could choose to have the old way "unanimous" where
all the MUC history is just grey (or whatever was set). Now it is always
just displayed like regular new incoming MUC text.
2020-04-25 17:19:02 +02:00
Michael Vetter
70683c07ab _mucwin_print_mention(): No need to assign pos 2020-04-20 16:02:19 +02:00
Michael Vetter
180ec2b474 Add to_jid field to ProfMessage struct
Is usefult in many cases if we want cleaner code.
Hope this edit didn't break anything though ;-)
2020-04-11 17:11:53 +02:00
Michael Vetter
f42f856d37 Retrieve message type from database
So we don't have to check for MUC another way.
2020-04-08 12:50:23 +02:00
Michael Vetter
067bc690f2 Adapt win_print_history() to work with muc too 2020-04-06 15:33:01 +02:00
Michael Vetter
3d7e6fae7c Use ProfMessage as parameter for win_println_incoming_muc_msg() 2020-03-09 12:00:15 +01:00
Michael Vetter
eb2fbdba2e Dont filter out own MUC messages if muc history is set to 'regular'
We use the same incoming function as for regular incoming text here. But
don't want to filter out our own messages since we didn't print them
during sending.

Follow up to 8ee2cdadc8
2020-02-21 18:46:09 +01:00
Michael Vetter
1f8b1eb740 Allow utf8 symbols as omemo/pgp/otr indicator char
Fix https://github.com/profanity-im/profanity/issues/1264
2020-02-20 23:36:10 +01:00
Michael Vetter
8ee2cdadc8 Parse mentions and triggers in muc history if display is 'regular'
Fix https://github.com/profanity-im/profanity/issues/1261
2020-02-20 10:28:24 +01:00
Michael Vetter
80dd3fdbb2 Add option to color MUC history like regular messages
`/logging group color` has:
* `unanimous` which will color it with one unanimous color. Like it was
done always.
* `regular` which colors it like regular incoming messages.

Regards https://github.com/profanity-im/profanity/issues/1261
2020-02-20 08:11:58 +01:00
Michael Vetter
6aa793fca6 Refactor mucwin_history()
Just pass ProfMessage.
2020-02-19 16:57:37 +01:00
Michael Vetter
ea5a947f52 Refactor win_print_history()
We never use the printf like behaviour anyways.
2020-02-17 12:05:58 +01:00
Michael Vetter
6e68f1812b Refactor win_print_outgoing_muc_msg()
We never use the printf like behaviour anyways.
2020-02-17 12:03:23 +01:00
Michael Vetter
f13ea11f95 Refactor win_println_incoming_muc_msg()
We never use the printf like behaviour anyways.
2020-02-17 11:58:36 +01:00
Michael Vetter
2900bf4aef Rename win_println_them_message() -> win_println_incoming_muc_msg()
In aa3693daa211b36c78d136d5a1ee9f3258e21352 I renamed
`win_println_me_message()` -> `win_print_outgoing_muc_msg()`.

Now: `win_println_them_message()` -> `win_println_incoming_muc_msg()`
to be more consistent and descriptive.
2020-02-14 10:17:07 +01:00
Michael Vetter
4ec005e4c3 xep-0308: Implement LMC for outgoing MUC messages
Including OMEMO encrypted ones.
Also rename `win_println_me_message()` to `win_print_outgoing_muc_msg()
as I think it's a more descriptive name.
2020-02-14 10:17:07 +01:00
Michael Vetter
7cd1be36f2 xep-0308: Display corrected incoming MUC messages correctly 2020-02-12 12:56:34 +01:00
Michael Vetter
be13e98fe7 Update my Copyright to 2020 2020-01-03 19:52:31 +01:00
Michael Vetter
3036834ec8 separator: Enable for MUC and PRIVWIN too
Fix https://github.com/profanity-im/profanity/issues/1238
2019-12-13 13:13:02 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
f71de61b9d Don't override ProfMessage Id with origin-id
Profanity sends the same value for both. Other clients might not.
Safe both since we could need them later.

Once we implement Last Message Correction we will need the regular id.
If we override it with origin-id and another client chooses to not use
the same value for id and origin-id then we can't interpret the id sent
with the LMC request correctly.
2019-10-31 13:45:44 +01:00
Michael Vetter
4ecd4dea6a Replace sent_messages list with algo
For OMEMO we had a list with our sent messages.
It was used so that we don't decrypt our own messages in MUCs that come
in via reflection.

Recently for https://github.com/profanity-im/profanity/pull/1209 we
started to use origin-id and use an algorithm so we can detect our own
sent messages via checking origin-id.

Profanity uses the same id for the message ID and origin-id.

With 06f300a42c we added the
message_is_sent_by_us() function.

We implemented XEP-0359 this way to fix
https://github.com/profanity-im/profanity/issues/1201 so that we don't
log our own messages in MUCs twice.

We can now check whether the message was sent by us using this function
and can get rid of the list.

Probably we could also put many parts of the sv_ev_room_message()
function inside (else) part of `if (!(g_strcmp0(mynick,
message->jid->resourcepart) == 0 && message_is_sent_by_us(message))) {`.

Have to look more closely whether any of this needs to be run in case
the message actually comes from us.
2019-10-31 12:56:48 +01:00
Michael Vetter
6161235733 Remove not needed code
Was left over from refactoring a long time ago.
2019-09-29 15:47:24 +02:00
Paul Fariello
f831f65737 Rename prof_message_t into ProfMessage 2019-06-20 14:30:45 +02:00
Paul Fariello
9482ce6168 Set foreground color for untrusted messages 2019-06-20 14:30:45 +02:00
Paul Fariello
44d16e9141 Add prof_message_t to wrap all message attributes
Probably missing copy of body to plain in carbon and privmessage.
Only covers the incoming message path because goal is OMEMO decryption
of untrusted message.
Cover some of the log functions but not all.
2019-06-20 14:30:42 +02:00
Michael Vetter
40b72ffe55 Add myself to copyright
Like discussed with James.
2019-06-17 10:44:08 +02:00
Michael Vetter
47e55cc112 Safe last MUC message timestamp per MUC
After pasis review of my code he thinks it's better to safe the
timestamp per MUC so we can account for some problems that could occur
with timing.
2019-06-11 06:35:03 +02:00
Paul Fariello
21ae946896 Handle MUC anonymous state when auto starting OMEMO
When auto joining a MUC we don't have access to required information so
we just don't start OMEMO at this time.

Once we receive disco info we then try to start OMEMO.
2019-04-17 14:03:14 +02:00
Paul Fariello
5f015e32b2 Add OMEMO policy
There is 3 policy:

- manual: OMEMO session are only started manually
- automatic: OMEMO session are only started if they have been started
  manually before
- always: OMEMO session are always started unless they have been ended
  manually before

Closes #1040 and fixes #1052
2019-04-17 14:03:14 +02:00