Mercurial > hg
comparison mcabber/src/commands.c @ 1602:f4a2c6f767d1
Message Receipts support (XEP-0184)
author | franky |
---|---|
date | Wed, 24 Sep 2008 11:41:29 +0200 |
parents | dcd5d4c75199 |
children | 54029aba9452 |
comparison
equal
deleted
inserted
replaced
1601:3efc92a48945 | 1602:f4a2c6f767d1 |
---|---|
1112 char *bare_jid, *rp; | 1112 char *bare_jid, *rp; |
1113 char *hmsg; | 1113 char *hmsg; |
1114 gint crypted; | 1114 gint crypted; |
1115 gint retval = 0; | 1115 gint retval = 0; |
1116 int isroom; | 1116 int isroom; |
1117 gpointer xep184 = NULL; | |
1117 | 1118 |
1118 if (!lm_connection_is_authenticated(lconnection)) { | 1119 if (!lm_connection_is_authenticated(lconnection)) { |
1119 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); | 1120 scr_LogPrint(LPRINT_NORMAL, "You are not connected."); |
1120 return 1; | 1121 return 1; |
1121 } | 1122 } |
1160 else | 1161 else |
1161 hmsg = (char*)msg; | 1162 hmsg = (char*)msg; |
1162 | 1163 |
1163 // Network part | 1164 // Network part |
1164 xmpp_send_msg(fjid, msg, (isroom ? ROSTER_TYPE_ROOM : ROSTER_TYPE_USER), | 1165 xmpp_send_msg(fjid, msg, (isroom ? ROSTER_TYPE_ROOM : ROSTER_TYPE_USER), |
1165 subj, FALSE, &crypted, type_overwrite); | 1166 subj, FALSE, &crypted, type_overwrite, &xep184); |
1166 | 1167 |
1167 if (crypted == -1) { | 1168 if (crypted == -1) { |
1168 scr_LogPrint(LPRINT_LOGNORM, "Encryption error. Message was not sent."); | 1169 scr_LogPrint(LPRINT_LOGNORM, "Encryption error. Message was not sent."); |
1169 retval = 1; | 1170 retval = 1; |
1170 goto send_message_to_return; | 1171 goto send_message_to_return; |
1171 } | 1172 } |
1172 | 1173 |
1173 // Hook | 1174 // Hook |
1174 if (!isroom) | 1175 if (!isroom) |
1175 hk_message_out(bare_jid, rp, 0, hmsg, crypted); | 1176 hk_message_out(bare_jid, rp, 0, hmsg, crypted, xep184); |
1176 | 1177 |
1177 send_message_to_return: | 1178 send_message_to_return: |
1178 if (hmsg != msg) g_free(hmsg); | 1179 if (hmsg != msg) g_free(hmsg); |
1179 if (rp) g_free(bare_jid); | 1180 if (rp) g_free(bare_jid); |
1180 return retval; | 1181 return retval; |
2628 arg = NULL; | 2629 arg = NULL; |
2629 | 2630 |
2630 arg = to_utf8(arg); | 2631 arg = to_utf8(arg); |
2631 // Set the topic | 2632 // Set the topic |
2632 xmpp_send_msg(buddy_getjid(bud), NULL, ROSTER_TYPE_ROOM, arg ? arg : "", | 2633 xmpp_send_msg(buddy_getjid(bud), NULL, ROSTER_TYPE_ROOM, arg ? arg : "", |
2633 FALSE, NULL, LM_MESSAGE_SUB_TYPE_NOT_SET); | 2634 FALSE, NULL, LM_MESSAGE_SUB_TYPE_NOT_SET, NULL); |
2634 g_free(arg); | 2635 g_free(arg); |
2635 } | 2636 } |
2636 | 2637 |
2637 static void room_destroy(gpointer bud, char *arg) | 2638 static void room_destroy(gpointer bud, char *arg) |
2638 { | 2639 { |