Changeset efa8586 in code for icb.c


Ignore:
Timestamp:
Mar 4, 2014, 11:59:20 PM (11 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
c9402c3
Parents:
b7bc432
Message:

When doing privmsg do username lookups in all groups until the first match

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icb.c

    rb7bc432 refa8586  
    254254        icb_vis(whom, to, ICB_MAXNICKLEN, VIS_SP);
    255255
     256        /* try home group first */
    256257        LIST_FOREACH(s, &ig->sess, entry) {
    257258                if (strcmp(s->nick, whom) == 0)
     
    259260        }
    260261        if (!s) {
    261                 icb_error(is, "No such user %s", whom);
    262                 return;
     262                /* try all groups until the first match */
     263                LIST_FOREACH(ig, &groups, entry) {
     264                        LIST_FOREACH(s, &ig->sess, entry) {
     265                                if (strcmp(s->nick, whom) == 0)
     266                                        break;
     267                        }
     268                        if (s)
     269                                break;
     270                }
     271                if (!s) {
     272                        icb_error(is, "No such user %s", whom);
     273                        return;
     274                }
    263275        }
    264276        icb_sendfmt(s, "%c%s%c%s", ICB_M_PERSONAL, is->nick, ICB_M_SEP, msg);
Note: See TracChangeset for help on using the changeset viewer.