Changeset 4c3519a
- Timestamp:
- 2010-04-14T22:45:09Z (15 years ago)
- Branches:
- master
- Children:
- e7edbb7
- Parents:
- 003a12b
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_user.c
r003a12b r4c3519a 145 145 return "Offline"; 146 146 else if( bu->flags & BEE_USER_AWAY ) 147 /* TODO: status msgs, etc. */ 148 return bu->status; 147 { 148 if( bu->status_msg ) 149 { 150 static char ret[MAX_STRING]; 151 g_snprintf( ret, MAX_STRING - 1, "%s (%s)", 152 bu->status ? : "Away", bu->status_msg ); 153 return ret; 154 } 155 else 156 return bu->status ? : "Away"; 157 } 149 158 } 150 159 -
root_commands.c
r003a12b r4c3519a 881 881 } 882 882 883 #if 0884 883 static void cmd_blist( irc_t *irc, char **cmd ) 885 884 { 886 885 int online = 0, away = 0, offline = 0; 887 user_t *u;886 GSList *l; 888 887 char s[256]; 889 888 char *format; … … 906 905 format = "%-16.16s %-40.40s %s"; 907 906 908 irc_usermsg( irc, format, "Nick", "User/Host/Network", "Status" ); 909 910 for( u = irc->users; u; u = u->next ) if( u->ic && u->online && !u->away ) 911 { 907 irc_usermsg( irc, format, "Nick", "Handle/Account", "Status" ); 908 909 for( l = irc->users; l; l = l->next ) 910 { 911 irc_user_t *iu = l->data; 912 bee_user_t *bu = iu->bu; 913 914 if( !bu || ( bu->flags & ( BEE_USER_ONLINE | BEE_USER_AWAY ) ) != BEE_USER_ONLINE ) 915 continue; 916 912 917 if( online == 1 ) 913 918 { 914 919 char st[256] = "Online"; 915 920 916 if( u->status_msg )917 g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg );921 if( bu->status_msg ) 922 g_snprintf( st, sizeof( st ) - 1, "Online (%s)", bu->status_msg ); 918 923 919 g_snprintf( s, sizeof( s ) - 1, "%s @%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name,u->ic->acc->user );920 irc_usermsg( irc, format, u->nick, s, st );924 g_snprintf( s, sizeof( s ) - 1, "%s %s(%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user ); 925 irc_usermsg( irc, format, iu->nick, s, st ); 921 926 } 922 927 … … 924 929 } 925 930 926 for( u = irc->users; u; u = u->next ) if( u->ic && u->online && u->away ) 927 { 931 for( l = irc->users; l; l = l->next ) 932 { 933 irc_user_t *iu = l->data; 934 bee_user_t *bu = iu->bu; 935 936 if( !bu || !( bu->flags & BEE_USER_ONLINE ) || !( bu->flags & BEE_USER_AWAY ) ) 937 continue; 938 928 939 if( away == 1 ) 929 940 { 930 g_snprintf( s, sizeof( s ) - 1, "%s @%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name,u->ic->acc->user );931 irc_usermsg( irc, format, u->nick, s, u->away);941 g_snprintf( s, sizeof( s ) - 1, "%s %s(%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user ); 942 irc_usermsg( irc, format, iu->nick, s, irc_user_get_away( iu ) ); 932 943 } 933 944 n_away ++; 934 945 } 935 946 936 for( u = irc->users; u; u = u->next ) if( u->ic && !u->online ) 937 { 947 for( l = irc->users; l; l = l->next ) 948 { 949 irc_user_t *iu = l->data; 950 bee_user_t *bu = iu->bu; 951 952 if( !bu || bu->flags & BEE_USER_ONLINE ) 953 continue; 954 938 955 if( offline == 1 ) 939 956 { 940 g_snprintf( s, sizeof( s ) - 1, "%s @%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name,u->ic->acc->user );941 irc_usermsg( irc, format, u->nick, s, "Offline" );957 g_snprintf( s, sizeof( s ) - 1, "%s %s(%s)", bu->handle, bu->ic->acc->prpl->name, bu->ic->acc->user ); 958 irc_usermsg( irc, format, iu->nick, s, "Offline" ); 942 959 } 943 960 n_offline ++; … … 947 964 } 948 965 966 #if 0 949 967 static void cmd_qlist( irc_t *irc, char **cmd ) 950 968 { … … 1146 1164 { "account", 1, cmd_account, 0 }, 1147 1165 { "add", 2, cmd_add, 0 }, 1166 { "blist", 0, cmd_blist, 0 }, 1148 1167 { "drop", 1, cmd_drop, 0 }, 1149 1168 { "help", 0, cmd_help, 0 }, … … 1159 1178 #if 0 1160 1179 { "allow", 1, cmd_allow, 0 }, 1161 { "blist", 0, cmd_blist, 0 },1162 1180 { "block", 1, cmd_block, 0 }, 1163 1181 { "chat", 1, cmd_chat, 0 }, 1164 1182 { "ft", 0, cmd_transfer, 0 }, 1165 { "join_chat", 2, cmd_join_chat, 0 },1166 1183 { "qlist", 0, cmd_qlist, 0 }, 1167 1184 { "transfer", 0, cmd_transfer, 0 },
Note: See TracChangeset
for help on using the changeset viewer.