/[svn]/branches/newio/src/s_user.c
ViewVC logotype

Diff of /branches/newio/src/s_user.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2428 by michael, Tue Jul 23 16:25:10 2013 UTC revision 2429 by michael, Wed Jul 31 16:43:22 2013 UTC
# Line 1119  user_set_hostmask(struct Client *target_ Line 1119  user_set_hostmask(struct Client *target_
1119                                   target_p->host, target_p->away);                                   target_p->host, target_p->away);
1120  }  }
1121    
1122    /** Call \a fmt for each Client named in \a names.
1123     * @param[in] sptr Client requesting information.
1124     * @param[in] names Space-delimited list of nicknames.
1125     * @param[in] rpl Base reply string for messages.
1126     * @param[in] fmt Formatting callback function.
1127     */
1128    void
1129    send_user_info(struct Client *source_p, char *names, int rpl, InfoFormatter fmt)
1130    {
1131      char *name = NULL;
1132      char *p = NULL;
1133      int arg_count = 0;
1134      int users_found = 0;
1135      struct Client *target_p = NULL;
1136      struct MsgBuf *mb = NULL;
1137    
1138      assert(source_p);
1139      assert(names);
1140      assert(fmt);
1141    
1142      mb = msgq_make(source_p, form_str(rpl), me.name, source_p->name);
1143    
1144      for (name = strtoken(&p, names, " "); name;
1145           name = strtoken(&p,  NULL, " "))
1146      {
1147        if ((target_p = find_person(source_p, name)))
1148        {
1149          if (users_found++)
1150            msgq_append(NULL, mb, " ");
1151          (*fmt)(target_p, source_p, mb);
1152        }
1153    
1154        if (++arg_count == 5)
1155          break;
1156      }
1157    
1158      send_buffer(source_p, mb, 0);
1159      msgq_clean(mb);
1160    }
1161    
1162  /* user_welcome()  /* user_welcome()
1163   *   *
1164   * inputs       - client pointer to client to welcome   * inputs       - client pointer to client to welcome

Legend:
Removed from v.2428  
changed lines
  Added in v.2429

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28