diff options
author | James Booth <boothj5@gmail.com> | 2014-05-24 16:59:45 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-24 16:59:45 +0100 |
commit | 8e14946aada9708c2c20c6e512ee7b0cf5767689 (patch) | |
tree | 3dcb3d453e30d5c39f1b4ea26a1188f5d699f5a9 /src/ui/core.c | |
parent | 866d87af79b5fb02d49b60b9cc2298448f4b2fd4 (diff) | |
download | profani-tty-8e14946aada9708c2c20c6e512ee7b0cf5767689.tar.gz |
Ignore case for chat room mention notification
Diffstat (limited to 'src/ui/core.c')
-rw-r--r-- | src/ui/core.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 67fa618f..c5e17803 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1701,8 +1701,14 @@ _ui_room_message(const char * const room_jid, const char * const nick, if (g_strcmp0(room_setting, "on") == 0) { notify = TRUE; } - if ( (g_strcmp0(room_setting, "mention") == 0) && (g_strrstr(message, nick) != NULL) ) { - notify = TRUE; + if (g_strcmp0(room_setting, "mention") == 0) { + char *message_lower = g_utf8_strdown(message, -1); + char *nick_lower = g_utf8_strdown(nick, -1); + if (g_strrstr(message_lower, nick_lower) != NULL) { + notify = TRUE; + } + g_free(message_lower); + g_free(nick_lower); } if (notify) { Jid *jidp = jid_create(room_jid); |