about summary refs log tree commit diff stats
path: root/src/xmpp/message.h
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-10-07 00:01:18 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-10-07 00:05:37 +0200
commitb3ed21366879c53792277c069766e2d7f6cd5c5b (patch)
treebe1c3076f44e3368126b79bd4e13a0fb476ace2f /src/xmpp/message.h
parentf1d31e024cd25be5978d933968b311d3df2a71b9 (diff)
downloadprofani-tty-b3ed21366879c53792277c069766e2d7f6cd5c5b.tar.gz
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
Diffstat (limited to 'src/xmpp/message.h')
-rw-r--r--src/xmpp/message.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xmpp/message.h b/src/xmpp/message.h
index 7660e9a9..badfba72 100644
--- a/src/xmpp/message.h
+++ b/src/xmpp/message.h
@@ -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);