1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Fix typing notification

With d1d0ad8d1a we set a timestamp to now
for all messages upon receival. Even if the original message didn't
contain any timestamp. So we can use the timestamp of retrieval for
logging and displaying and don't get them at each of those location
where they might differ.

This means that timestamp will never be NULL.

I don't see why we would want to check for the chat state only if
timestamp isn't there.

Probably because in XEP-0085 there is not timestamp defined.
So if it thats stanza it's not there and we can parse quicker, but there
is nothing forbidden it to be there.

Related to https://github.com/profanity-im/profanity/issues/1339
This commit is contained in:
Michael Vetter 2020-05-21 12:24:03 +02:00
parent fcd69532ad
commit e41ae21bea

View File

@ -1265,7 +1265,7 @@ _handle_chat(xmpp_stanza_t *const stanza, gboolean is_mam)
} }
// handle chat sessions and states // handle chat sessions and states
if (!message->timestamp && jid->resourcepart) { if (jid->resourcepart) {
gboolean gone = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_GONE) != NULL; gboolean gone = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_GONE) != NULL;
gboolean typing = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_COMPOSING) != NULL; gboolean typing = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_COMPOSING) != NULL;
gboolean paused = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_PAUSED) != NULL; gboolean paused = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_PAUSED) != NULL;