/[weechat]/weechat/src/irc/irc-recv.c
ViewVC logotype

Diff of /weechat/src/irc/irc-recv.c

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

revision 1.2 by flashcode, Thu Oct 9 22:19:56 2003 UTC revision 1.3 by flashcode, Sat Oct 11 00:25:47 2003 UTC
# Line 1109  irc_cmd_recv_004 (t_irc_server *server, Line 1109  irc_cmd_recv_004 (t_irc_server *server,
1109  }  }
1110    
1111  /*  /*
1112   * irc_cmd_recv_311: '311' command (away message)   * irc_cmd_recv_301: '301' command (away message)
1113   */   */
1114    
1115  int  int
# Line 1146  irc_cmd_recv_301 (t_irc_server *server, Line 1146  irc_cmd_recv_301 (t_irc_server *server,
1146      return 0;      return 0;
1147  }  }
1148    
1149    /*
1150     * irc_cmd_recv_302: '302' command (userhost)
1151     */
1152    
1153    int
1154    irc_cmd_recv_302 (t_irc_server *server, char *host, char *arguments)
1155    {
1156        char *pos_host, *ptr_next;
1157        
1158        /* make gcc happy */
1159        (void) host;
1160        
1161        arguments = strchr (arguments, ' ');
1162        if (arguments)
1163        {
1164            while (arguments[0] == ' ')
1165                arguments++;
1166            if (arguments[0] == ':')
1167                arguments++;
1168            while (arguments)
1169            {
1170                pos_host = strchr (arguments, '=');
1171                if (pos_host)
1172                {
1173                    pos_host[0] = '\0';
1174                    pos_host++;
1175                    
1176                    ptr_next = strchr (pos_host, ' ');
1177                    if (ptr_next)
1178                    {
1179                        ptr_next[0] = '\0';
1180                        ptr_next++;
1181                        while (ptr_next[0] == ' ')
1182                            ptr_next++;
1183                    }
1184                    
1185                    irc_display_prefix (server->window, PREFIX_SERVER);
1186                    gui_printf_color (server->window,
1187                                      COLOR_WIN_CHAT_NICK, "%s", arguments);
1188                    gui_printf_color (server->window,
1189                                      COLOR_WIN_CHAT, "=");
1190                    gui_printf_color (server->window,
1191                                      COLOR_WIN_CHAT_HOST, "%s\n", pos_host);
1192                }
1193                else
1194                    ptr_next = NULL;
1195                arguments = ptr_next;
1196                if (arguments && !arguments[0])
1197                    arguments = NULL;
1198            }
1199        }
1200        return 0;
1201    }
1202    
1203    /*
1204     * irc_cmd_recv_303: '303' command (ison)
1205     */
1206    
1207    int
1208    irc_cmd_recv_303 (t_irc_server *server, char *host, char *arguments)
1209    {
1210        char *ptr_next;
1211        
1212        /* make gcc happy */
1213        (void) host;
1214        
1215        irc_display_prefix (server->window, PREFIX_SERVER);
1216        gui_printf_color (server->window,
1217                          COLOR_WIN_CHAT, _("Users online: "));
1218        
1219        arguments = strchr (arguments, ' ');
1220        if (arguments)
1221        {
1222            while (arguments[0] == ' ')
1223                arguments++;
1224            if (arguments[0] == ':')
1225                arguments++;
1226            while (arguments)
1227            {
1228                ptr_next = strchr (arguments, ' ');
1229                if (ptr_next)
1230                {
1231                    ptr_next[0] = '\0';
1232                    ptr_next++;
1233                    while (ptr_next[0] == ' ')
1234                        ptr_next++;
1235                }
1236                gui_printf_color (server->window,
1237                                  COLOR_WIN_CHAT_NICK, "%s ", arguments);
1238                arguments = ptr_next;
1239                if (arguments && !arguments[0])
1240                    arguments = NULL;
1241            }
1242        }
1243        gui_printf (server->window, "\n");
1244        return 0;
1245    }
1246    
1247  /*  /*
1248   * irc_cmd_recv_311: '311' command (whois, user)   * irc_cmd_recv_311: '311' command (whois, user)
1249   */   */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26