comparison libpurple/protocols/msn/notification.c @ 28064:e7a2e2208f88

Display the full message when there are errors sending a MSN Mobile message which should match errors with regular messages. Maiku tells me this should work properly. Fixes #5448.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 22 Aug 2009 20:51:56 +0000
parents 35b6fd563056
children 7cebd7602c6e
comparison
equal deleted inserted replaced
28063:f1a8a28432f4 28064:e7a2e2208f88
1176 } 1176 }
1177 1177
1178 id = xmlnode_get_attrib(msg, "id"); 1178 id = xmlnode_get_attrib(msg, "id");
1179 1179
1180 if (id && !strcmp(id, "407")) { 1180 if (id && !strcmp(id, "407")) {
1181 /* TODO: Use this to NAK the transaction, maybe print the text, too. 1181 PurpleConversation *conv
1182 unsigned int trId; 1182 = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
1183 id = xmlnode_get_attrib(payloadNode, "id"); 1183 who, gc->account);
1184 trId = atol(id); 1184 if (conv != NULL) {
1185 */ 1185 purple_conversation_write(conv, NULL,
1186 purple_conv_present_error(who, gc->account, 1186 _("Mobile message was not sent because it was too long."),
1187 _("Mobile message was not sent because it was too long.")); 1187 PURPLE_MESSAGE_ERROR, time(NULL));
1188 1188
1189 if ((id = xmlnode_get_attrib(payloadNode, "id")) != NULL) {
1190 unsigned int trId = atol(id);
1191 MsnTransaction *trans;
1192 MsnMessage *msg;
1193
1194 trans = msn_history_find(cmdproc->history, trId);
1195 msg = (MsnMessage *)trans->data;
1196
1197 if (msg) {
1198 char *body_str = msn_message_to_string(msg);
1199 char *body_enc = g_markup_escape_text(body_str, -1);
1200
1201 purple_conversation_write(conv, NULL, body_enc,
1202 PURPLE_MESSAGE_RAW, time(NULL));
1203
1204 g_free(body_str);
1205 g_free(body_enc);
1206 msn_message_destroy(msg);
1207 trans->data = NULL;
1208 }
1209 }
1210 }
1189 } else { 1211 } else {
1190 serv_got_im(gc, who, text, 0, time(NULL)); 1212 serv_got_im(gc, who, text, 0, time(NULL));
1191 } 1213 }
1192 1214
1193 g_free(text); 1215 g_free(text);