mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Set mucuser in carbon case
Also we initialize mucuser properly. Now in case of a carbon of a MUC PM we sv_ev_incoming_carbon() which calls _sv_ev_incoming_plain() and then we log it via chat_log_msg_in() in there. But we also get the sv_ev_incoming_private_message() and call chat_log_msg_in() in there too. So the incoming message get's logged twice.
This commit is contained in:
parent
8c8c18c6fd
commit
7dd747b58d
@ -192,6 +192,7 @@ message_init(void)
|
|||||||
message->enc = PROF_MSG_ENC_PLAIN;
|
message->enc = PROF_MSG_ENC_PLAIN;
|
||||||
message->timestamp = NULL;
|
message->timestamp = NULL;
|
||||||
message->trusted = true;
|
message->trusted = true;
|
||||||
|
message->mucuser = false;
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
@ -914,6 +915,7 @@ _private_chat_handler(xmpp_stanza_t *const stanza)
|
|||||||
{
|
{
|
||||||
// standard chat message, use jid without resource
|
// standard chat message, use jid without resource
|
||||||
ProfMessage *message = message_init();
|
ProfMessage *message = message_init();
|
||||||
|
message->mucuser = TRUE;
|
||||||
|
|
||||||
const gchar *from = xmpp_stanza_get_from(stanza);
|
const gchar *from = xmpp_stanza_get_from(stanza);
|
||||||
message->jid = jid_create(from);
|
message->jid = jid_create(from);
|
||||||
@ -991,6 +993,12 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
|||||||
|
|
||||||
ProfMessage *message = message_init();
|
ProfMessage *message = message_init();
|
||||||
|
|
||||||
|
// check whether message was a MUC PM
|
||||||
|
xmpp_stanza_t *mucuser = xmpp_stanza_get_child_by_ns(message_stanza, STANZA_NS_MUC_USER);
|
||||||
|
if (mucuser) {
|
||||||
|
message->mucuser = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
// check omemo encryption
|
// check omemo encryption
|
||||||
#ifdef HAVE_OMEMO
|
#ifdef HAVE_OMEMO
|
||||||
message->plain = omemo_receive_message(message_stanza, &message->trusted);
|
message->plain = omemo_receive_message(message_stanza, &message->trusted);
|
||||||
|
Loading…
Reference in New Issue
Block a user