Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    r9698fc0 rc34247d  
    2828static xt_status jabber_chat_self_message(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);
    2929
    30 struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password,
    31                                    gboolean always_use_nicks)
     30struct groupchat *jabber_chat_join(struct im_connection *ic, const char *room, const char *nick, const char *password)
    3231{
    3332        struct jabber_chat *jc;
     
    5857                g_free(jc);
    5958                return NULL;
    60         }
    61 
    62         if (always_use_nicks) {
    63                 jc->flags = JCFLAG_ALWAYS_USE_NICKS;
    6459        }
    6560
     
    10095        g_free(cserv);
    10196
    102         c = jabber_chat_join(ic, rjid, jd->username, NULL, FALSE);
     97        c = jabber_chat_join(ic, rjid, jd->username, NULL);
    10398        g_free(rjid);
    10499        if (c == NULL) {
     
    249244}
    250245
    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 
    264246/* Not really the same syntax as the normal pkt_ functions, but this isn't
    265247   called by the xmltree parser directly and this way I can add some extra
     
    346328                        *s = 0; /* Should NEVER be NULL, but who knows... */
    347329                }
    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 
    353330                imcb_chat_add_buddy(chat, bud->ext_jid);
    354331                if (s) {
     
    356333                }
    357334        } 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) {
    359336                        char *reason = NULL;
    360337                        char *status = NULL;
     
    466443
    467444        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 : "";
    470446                if (g_strcmp0(chat->topic, subject_text) != 0) {
    471447                        bare_jid = (bud) ? jabber_get_bare_jid(bud->ext_jid) : NULL;
     
    503479                bare_jid = jabber_get_bare_jid(bud->ext_jid ? bud->ext_jid : bud->full_jid);
    504480                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;
    508482        } else {
    509483                final_from = nick;
Note: See TracChangeset for help on using the changeset viewer.