Mercurial > hg
comparison mcabber/src/hooks.c @ 728:421b337dc6d2
Chat window: Highlight the flag in our messages
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 06 Mar 2006 10:25:24 +0100 |
parents | ee03b56b93ee |
children | 39f67cade02c |
comparison
equal
deleted
inserted
replaced
727:1c3620668857 | 728:421b337dc6d2 |
---|---|
82 buddy_settype(roster_usr->data, ROSTER_TYPE_ROOM); | 82 buddy_settype(roster_usr->data, ROSTER_TYPE_ROOM); |
83 } | 83 } |
84 | 84 |
85 is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM); | 85 is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM); |
86 | 86 |
87 if (!is_groupchat && is_room) { | 87 if (is_room) { |
88 // This is a private message from a room participant | 88 if (!is_groupchat) { |
89 if (!resname) | 89 // This is a private message from a room participant |
90 resname = ""; | 90 if (!resname) |
91 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); | 91 resname = ""; |
92 if (!strncmp(msg, "/me ", 4)) | 92 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); |
93 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); | 93 if (!strncmp(msg, "/me ", 4)) |
94 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); | |
95 message_flags |= HBB_PREFIX_HLIGHT; | |
96 } else { | |
97 // This is a regular chatroom message. | |
98 // Let's see if we are the message sender, in which case we'll | |
99 // highlight it. | |
100 const char *nick = buddy_getnickname(roster_usr->data); | |
101 if (resname && nick && !strcmp(resname, nick)) | |
102 message_flags |= HBB_PREFIX_HLIGHT; | |
103 } | |
94 } | 104 } |
95 | 105 |
96 if (type && !strcmp(type, "error")) { | 106 if (type && !strcmp(type, "error")) { |
97 message_flags = HBB_PREFIX_ERR | HBB_PREFIX_IN; | 107 message_flags = HBB_PREFIX_ERR | HBB_PREFIX_IN; |
98 scr_LogPrint(LPRINT_LOGNORM, "Error message received from <%s>", jid); | 108 scr_LogPrint(LPRINT_LOGNORM, "Error message received from <%s>", jid); |