Changeset 537d9b9 for protocols/jabber/conference.c
- Timestamp:
- 2016-11-20T08:40:36Z (8 years ago)
- Children:
- 3f44e43
- Parents:
- ba52ac5 (diff), 9f03c47 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
rba52ac5 r537d9b9 28 28 static xt_status jabber_chat_self_message(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 29 29 30 struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password) 30 struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password, 31 gboolean always_use_nicks) 31 32 { 32 33 struct jabber_chat *jc; … … 57 58 g_free(jc); 58 59 return NULL; 60 } 61 62 if (always_use_nicks) { 63 jc->flags = JCFLAG_ALWAYS_USE_NICKS; 59 64 } 60 65 … … 95 100 g_free(cserv); 96 101 97 c = jabber_chat_join(ic, rjid, jd->username, NULL );102 c = jabber_chat_join(ic, rjid, jd->username, NULL, FALSE); 98 103 g_free(rjid); 99 104 if (c == NULL) { … … 244 249 } 245 250 251 static int jabber_chat_has_other_resources(struct im_connection *ic, struct jabber_buddy *bud) 252 { 253 struct jabber_buddy *cur; 254 255 for (cur = jabber_buddy_by_jid(ic, bud->bare_jid, GET_BUDDY_FIRST); cur; cur = cur->next) { 256 if (cur != bud && jabber_compare_jid(cur->ext_jid, bud->ext_jid)) { 257 return TRUE; 258 } 259 } 260 261 return FALSE; 262 } 263 246 264 /* Not really the same syntax as the normal pkt_ functions, but this isn't 247 265 called by the xmltree parser directly and this way I can add some extra … … 328 346 *s = 0; /* Should NEVER be NULL, but who knows... */ 329 347 } 348 349 if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) { 350 imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource); 351 } 352 330 353 imcb_chat_add_buddy(chat, bud->ext_jid); 331 354 if (s) { … … 333 356 } 334 357 } else if (type) { /* type can only be NULL or "unavailable" in this function */ 335 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid ) {358 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid && !jabber_chat_has_other_resources(ic, bud)) { 336 359 char *reason = NULL; 337 360 char *status = NULL; … … 443 466 444 467 if (subject && chat) { 445 char *subject_text = subject->text_len > 0 ? subject->text : ""; 468 char empty[1] = ""; 469 char *subject_text = subject->text_len > 0 ? subject->text : empty; 446 470 if (g_strcmp0(chat->topic, subject_text) != 0) { 447 471 bare_jid = (bud) ? jabber_get_bare_jid(bud->ext_jid) : NULL; … … 479 503 bare_jid = jabber_get_bare_jid(bud->ext_jid ? bud->ext_jid : bud->full_jid); 480 504 final_from = bare_jid; 481 flags = (bud == jc->me) ? OPT_SELFMESSAGE : 0; 505 if (bud == jc->me || (g_strcasecmp(final_from, ic->acc->user) == 0)) { 506 flags = OPT_SELFMESSAGE; 507 } 482 508 } else { 483 509 final_from = nick;
Note: See TracChangeset
for help on using the changeset viewer.