Changeset 83f179d6 for protocols/jabber
- Timestamp:
- 2015-08-08T04:29:54Z (9 years ago)
- Branches:
- master
- Children:
- 666722e
- Parents:
- 6b56512
- git-author:
- dequis <dx@…> (08-08-15 04:17:47)
- git-committer:
- dequis <dx@…> (08-08-15 04:29:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r6b56512 r83f179d6 331 331 } else if (type) { /* type can only be NULL or "unavailable" in this function */ 332 332 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid) { 333 char *reason = NULL; 334 335 if ((c = xt_find_node_by_attr(node->children, "x", "xmlns", XMLNS_MUC_USER))) { 336 struct xt_node *c2; 337 char *status = NULL; 338 339 if ((c2 = xt_find_node(c->children, "status"))) { 340 status = xt_find_attr(c2, "code"); 341 if (g_strcmp0(status, "301") == 0) { 342 status = "Banned"; 343 } else if (g_strcmp0(status, "303") == 0) { 344 /* This could be handled in a cleverer way, 345 * but let's just show a literal part/join for now */ 346 status = "Changing nicks"; 347 } else if (g_strcmp0(status, "307") == 0) { 348 status = "Kicked"; 349 } 350 } 351 352 if ((c2 = xt_find_path(c, "item/reason")) && c2->text && c2->text_len) { 353 if (status) { 354 reason = g_strdup_printf("%s: %s", status, c2->text); 355 } else { 356 reason = g_strdup(c2->text); 357 } 358 } else { 359 reason = g_strdup(status); 360 } 361 } 362 333 363 s = strchr(bud->ext_jid, '/'); 334 364 if (s) { 335 365 *s = 0; 336 366 } 337 imcb_chat_remove_buddy(chat, bud->ext_jid, NULL);367 imcb_chat_remove_buddy(chat, bud->ext_jid, reason); 338 368 if (bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS) { 339 imcb_remove_buddy(ic, bud->ext_jid, NULL);369 imcb_remove_buddy(ic, bud->ext_jid, reason); 340 370 } 341 371 if (s) { 342 372 *s = '/'; 343 373 } 374 375 g_free(reason); 344 376 } 345 377
Note: See TracChangeset
for help on using the changeset viewer.