After adding MAM quote and url autocompletion wouldn't pick up messages
from MAM or history(from DB) or would have them in the wrong order. This
commit fixes that.
Fixes https://github.com/profanity-im/profanity/issues/1770
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.
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.
`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.
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
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.
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
`/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
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.
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.
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.
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.