110 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { |
111 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { |
111 g_free(mmsg); |
112 g_free(mmsg); |
112 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); |
113 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); |
113 } |
114 } |
114 } |
115 } |
|
116 message_flags |= HBB_PREFIX_HLIGHT; |
115 } else { |
117 } else { |
116 // This is a regular chatroom message. |
118 // This is a regular chatroom message. |
117 // Let's see if we are the message sender, in which case we'll |
|
118 // highlight it. |
|
119 const char *nick = buddy_getnickname(roster_usr->data); |
119 const char *nick = buddy_getnickname(roster_usr->data); |
120 if (resname && nick && !strcmp(resname, nick)) |
120 |
121 message_flags |= HBB_PREFIX_HLIGHT; |
121 if (nick) { |
|
122 // Let's see if we are the message sender, in which case we'll |
|
123 // highlight it. |
|
124 if (resname && !strcmp(resname, nick)) { |
|
125 message_flags |= HBB_PREFIX_HLIGHT_OUT; |
|
126 } else { |
|
127 // We're not the sender. Can we see our nick? |
|
128 if (startswith(msg, nick, TRUE)) { |
|
129 // The message starts with our nick. Let's check it's not |
|
130 // followed immediately by an alphnumeric character. |
|
131 if (!iswalnum(get_char(msg+strlen(nick)))) |
|
132 message_flags |= HBB_PREFIX_HLIGHT; |
|
133 } |
|
134 // We could do a more global check... |
|
135 } |
|
136 } |
122 } |
137 } |
123 } |
138 } |
124 |
139 |
125 if (type && !strcmp(type, "error")) { |
140 if (type && !strcmp(type, "error")) { |
126 message_flags = HBB_PREFIX_ERR | HBB_PREFIX_IN; |
141 message_flags = HBB_PREFIX_ERR | HBB_PREFIX_IN; |