mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 22:36:21 +00:00
Improve MUC 1:1 logging
If we get a private message from a user in a MUC profanity shows this like: `profanity@roomsASDF.dismail.de/Martin: Hi` This was so far logged at: `~/.local/share/profanity/chatlogs/my-account-at-server/profanity_at_rooms.dismail.de/2019_09_04.log` as: ``` 10:48:13 - profanity@rooms.dismail.de: Hi ``` So the nickname was not saved anywhere. This is due to us not knowing whether we got a regular message from user@server.org/resource or a MUC PM from room@server.org/user. We now check for `<x xmlns='http://jabber.org/protocol/muc#user' />` and add the resourcepart to the logging if we get it. The file will be created at `~/.local/share/profanity/chatlogs/my-account-at-server/profanity_at_rooms.dismail.de_nick` and look like: ``` 23:59:43 - nick: Hi ``` Fix https://github.com/profanity-im/profanity/issues/1184
This commit is contained in:
@@ -1089,6 +1089,10 @@ _handle_chat(xmpp_stanza_t *const stanza)
|
||||
ProfMessage *message = message_init();
|
||||
message->jid = jid;
|
||||
|
||||
if (mucuser) {
|
||||
message->mucuser = TRUE;
|
||||
}
|
||||
|
||||
message->timestamp = stanza_get_delay(stanza);
|
||||
if (body) {
|
||||
message->body = xmpp_stanza_get_text(body);
|
||||
|
||||
@@ -56,6 +56,7 @@ typedef struct prof_message_t {
|
||||
GDateTime *timestamp;
|
||||
prof_enc_t enc;
|
||||
gboolean trusted;
|
||||
gboolean mucuser;
|
||||
} ProfMessage;
|
||||
|
||||
typedef int(*ProfMessageCallback)(xmpp_stanza_t *const stanza, void *const userdata);
|
||||
|
||||
Reference in New Issue
Block a user