Changeset fb2338d for protocols/jabber
- Timestamp:
- 2015-10-30T10:28:32Z (9 years ago)
- Branches:
- master
- Children:
- 884577f
- Parents:
- 345577b
- git-author:
- dequis <dx@…> (13-09-15 04:45:43)
- git-committer:
- dequis <dx@…> (30-10-15 10:28:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r345577b rfb2338d 26 26 27 27 static xt_status jabber_chat_join_failed(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 28 static xt_status jabber_chat_self_message(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 28 29 29 30 struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password) … … 127 128 } 128 129 130 static xt_status jabber_chat_self_message(struct im_connection *ic, struct xt_node *node, struct xt_node *orig) 131 { 132 /* This is a self message sent by this bitlbee - just drop it */ 133 return XT_ABORT; 134 } 135 129 136 struct groupchat *jabber_chat_by_jid(struct im_connection *ic, const char *name) 130 137 { … … 171 178 node = jabber_make_packet("message", "groupchat", jc->name, node); 172 179 173 if (!jabber_write_packet(ic, node)) { 174 xt_free_node(node); 175 return 0; 176 } 177 xt_free_node(node); 178 179 return 1; 180 jabber_cache_add(ic, node, jabber_chat_self_message); 181 182 return !jabber_write_packet(ic, node); 180 183 } 181 184 … … 403 406 char *final_from = NULL; 404 407 char *bare_jid = NULL; 408 guint32 flags = 0; 405 409 406 410 from = (bud) ? bud->full_jid : xt_find_attr(node, "from"); … … 466 470 imcb_chat_log(chat, "From conference server: %s", body->text); 467 471 return; 468 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me ) {469 /* exclude self-messages since they would get filtered out470 * but not the ones in the backlog*/472 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me && 473 (jabber_cache_handle_packet(ic, node) == XT_ABORT)) { 474 /* Self message marked by this bitlbee, don't show it */ 471 475 return; 472 476 } 473 477 474 if (bud && jc && bud != jc->me) {478 if (bud) { 475 479 bare_jid = jabber_get_bare_jid(bud->ext_jid ? bud->ext_jid : bud->full_jid); 476 480 final_from = bare_jid; 481 flags = (bud == jc->me) ? OPT_SELFMESSAGE : 0; 477 482 } else { 478 483 final_from = nick; 479 484 } 480 485 481 imcb_chat_msg(chat, final_from, body->text, 0, jabber_get_timestamp(node));486 imcb_chat_msg(chat, final_from, body->text, flags, jabber_get_timestamp(node)); 482 487 483 488 g_free(bare_jid);
Note: See TracChangeset
for help on using the changeset viewer.