Changes in protocols/jabber/conference.c [9698fc0:c34247d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r9698fc0 rc34247d 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, 31 gboolean always_use_nicks) 30 struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password) 32 31 { 33 32 struct jabber_chat *jc; … … 58 57 g_free(jc); 59 58 return NULL; 60 }61 62 if (always_use_nicks) {63 jc->flags = JCFLAG_ALWAYS_USE_NICKS;64 59 } 65 60 … … 100 95 g_free(cserv); 101 96 102 c = jabber_chat_join(ic, rjid, jd->username, NULL , FALSE);97 c = jabber_chat_join(ic, rjid, jd->username, NULL); 103 98 g_free(rjid); 104 99 if (c == NULL) { … … 249 244 } 250 245 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 264 246 /* Not really the same syntax as the normal pkt_ functions, but this isn't 265 247 called by the xmltree parser directly and this way I can add some extra … … 346 328 *s = 0; /* Should NEVER be NULL, but who knows... */ 347 329 } 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 353 330 imcb_chat_add_buddy(chat, bud->ext_jid); 354 331 if (s) { … … 356 333 } 357 334 } else if (type) { /* type can only be NULL or "unavailable" in this function */ 358 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid && !jabber_chat_has_other_resources(ic, bud)) {335 if ((bud->flags & JBFLAG_IS_CHATROOM) && bud->ext_jid) { 359 336 char *reason = NULL; 360 337 char *status = NULL; … … 466 443 467 444 if (subject && chat) { 468 char empty[1] = ""; 469 char *subject_text = subject->text_len > 0 ? subject->text : empty; 445 char *subject_text = subject->text_len > 0 ? subject->text : ""; 470 446 if (g_strcmp0(chat->topic, subject_text) != 0) { 471 447 bare_jid = (bud) ? jabber_get_bare_jid(bud->ext_jid) : NULL; … … 503 479 bare_jid = jabber_get_bare_jid(bud->ext_jid ? bud->ext_jid : bud->full_jid); 504 480 final_from = bare_jid; 505 if (bud == jc->me || (g_strcasecmp(final_from, ic->acc->user) == 0)) { 506 flags = OPT_SELFMESSAGE; 507 } 481 flags = (bud == jc->me) ? OPT_SELFMESSAGE : 0; 508 482 } else { 509 483 final_from = nick;
Note: See TracChangeset
for help on using the changeset viewer.