comparison mcabber/mcabber/xmpp.c @ 2090:16b04d64ec88

Add option to highlight timestamp added by server.
author Hermitifier
date Thu, 03 Apr 2014 16:11:16 +0200
parents 91a8f3740a1a
children 1210a22726d3
comparison
equal deleted inserted replaced
2089:91a8f3740a1a 2090:16b04d64ec88
1217 1217
1218 // Get the bare-JID/room (bjid) and the resource/nickname (res) 1218 // Get the bare-JID/room (bjid) and the resource/nickname (res)
1219 bjid = g_strdup(lm_message_get_from(m)); 1219 bjid = g_strdup(lm_message_get_from(m));
1220 res = strchr(bjid, JID_RESOURCE_SEPARATOR); 1220 res = strchr(bjid, JID_RESOURCE_SEPARATOR);
1221 if (res) *res++ = 0; 1221 if (res) *res++ = 0;
1222
1223 // Timestamp?
1224 timestamp = lm_message_node_get_timestamp(m->node);
1222 1225
1223 p = lm_message_node_get_child_value(m->node, "subject"); 1226 p = lm_message_node_get_child_value(m->node, "subject");
1224 if (p != NULL) { 1227 if (p != NULL) {
1225 if (mstype != LM_MESSAGE_SUB_TYPE_GROUPCHAT) { 1228 if (mstype != LM_MESSAGE_SUB_TYPE_GROUPCHAT) {
1226 // Chat message 1229 // Chat message
1245 if (*subj) 1248 if (*subj)
1246 mbuf = g_strdup_printf("%s has set the topic to: %s", res, subj); 1249 mbuf = g_strdup_printf("%s has set the topic to: %s", res, subj);
1247 else 1250 else
1248 mbuf = g_strdup_printf("%s has cleared the topic", res); 1251 mbuf = g_strdup_printf("%s has cleared the topic", res);
1249 } 1252 }
1250 scr_WriteIncomingMessage(bjid, mbuf, 0, 1253 scr_WriteIncomingMessage(bjid, mbuf, timestamp,
1251 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); 1254 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0);
1252 if (settings_opt_get_int("log_muc_conf")) 1255 if (settings_opt_get_int("log_muc_conf"))
1253 hlog_write_message(bjid, 0, -1, mbuf); 1256 hlog_write_message(bjid, 0, -1, mbuf);
1254 g_free(mbuf); 1257 g_free(mbuf);
1255 // The topic is displayed in the chat status line, so refresh now. 1258 // The topic is displayed in the chat status line, so refresh now.
1256 scr_update_chat_status(TRUE); 1259 scr_update_chat_status(TRUE);
1257 } 1260 }
1258 } 1261 }
1259
1260 // Timestamp?
1261 timestamp = lm_message_node_get_timestamp(m->node);
1262 1262
1263 if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { 1263 if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) {
1264 x = lm_message_node_get_child(m->node, "error"); 1264 x = lm_message_node_get_child(m->node, "error");
1265 display_server_error(x, from); 1265 display_server_error(x, from);
1266 #if defined XEP0022 || defined XEP0085 1266 #if defined XEP0022 || defined XEP0085