Changeset 7b71feb
- Timestamp:
- 2010-05-13T23:34:38Z (15 years ago)
- Branches:
- master
- Children:
- 4469e7e
- Parents:
- ad404ab
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
rad404ab r7b71feb 193 193 struct bee_group *group; 194 194 struct account *account; 195 }; 196 197 struct irc_groupchat_stub 198 { 199 struct account *acc; 200 char *room; 195 201 }; 196 202 -
irc_channel.c
rad404ab r7b71feb 313 313 } 314 314 315 static gboolean groupchat_stub_join( irc_channel_t *ic ) 316 { 317 struct irc_groupchat_stub *igs = ic->data; 318 319 if( igs && igs->acc->ic && igs->acc->prpl->chat_join ) 320 { 321 ic->flags |= IRC_CHANNEL_CHAT_PICKME; 322 igs->acc->prpl->chat_join( igs->acc->ic, igs->room, ic->irc->user->nick, NULL ); 323 ic->flags &= ~IRC_CHANNEL_CHAT_PICKME; 324 return FALSE; 325 } 326 else 327 { 328 irc_send_num( ic->irc, 403, "%s :Can't join channel, account offline?", ic->name ); 329 return FALSE; 330 } 331 } 332 315 333 static const struct irc_channel_funcs groupchat_stub_funcs = { 316 334 NULL, 317 NULL,335 groupchat_stub_join, 318 336 NULL, 319 337 NULL, -
irc_commands.c
rad404ab r7b71feb 139 139 return; /* Dude, you're already there... 140 140 RFC doesn't have any reply for that though? */ 141 142 if( ic->f->join && !ic->f->join( ic ) ) 143 /* The story is: FALSE either means the handler showed an error 144 message, or is doing some work before the join should be 145 confirmed. (In the latter case, the caller should take care 146 of that confirmation.) 147 TRUE means all's good, let the user join the channel right away. */ 148 return; 141 149 142 150 irc_channel_add_user( ic, irc->user ); -
root_commands.c
rad404ab r7b71feb 940 940 } 941 941 942 #if 0943 static set_t **cmd_chat_set_findhead( irc_t *irc, char *id )944 {945 struct chat *c;946 947 if( ( c = chat_get( irc, id ) ) )948 return &c->set;949 else950 return NULL;951 }952 953 942 static void cmd_chat( irc_t *irc, char **cmd ) 954 943 { … … 959 948 { 960 949 char *channel, *s; 950 struct irc_channel *ic; 961 951 962 952 MIN_ARGS( 3 ); 963 953 964 if( !( acc = account_get( irc , cmd[2] ) ) )954 if( !( acc = account_get( irc->b, cmd[2] ) ) ) 965 955 { 966 956 irc_usermsg( irc, "Invalid account" ); … … 981 971 if( strchr( CTYPES, channel[0] ) == NULL ) 982 972 { 983 s = g_strdup_printf( " %c%s", CTYPES[0], channel );973 s = g_strdup_printf( "#%s", channel ); 984 974 g_free( channel ); 985 975 channel = s; 986 976 } 987 977 988 if( ( c = chat_add( irc, acc, cmd[3], channel ) ) ) 989 irc_usermsg( irc, "Chatroom added successfully." ); 990 else 991 irc_usermsg( irc, "Could not add chatroom." ); 992 993 g_free( channel ); 994 } 995 else if( g_strcasecmp( cmd[1], "list" ) == 0 ) 996 { 997 int i = 0; 998 999 if( strchr( irc->umode, 'b' ) ) 1000 irc_usermsg( irc, "Chatroom list:" ); 1001 1002 for( c = irc->chatrooms; c; c = c->next ) 1003 { 1004 irc_usermsg( irc, "%2d. %s(%s) %s, %s", i, c->acc->prpl->name, 1005 c->acc->user, c->handle, c->channel ); 978 if( ( ic = irc_channel_new( irc, channel ) ) ) 979 { 980 struct irc_groupchat_stub *igs; 1006 981 1007 i ++; 1008 } 1009 irc_usermsg( irc, "End of chatroom list" ); 1010 } 1011 else if( g_strcasecmp( cmd[1], "set" ) == 0 ) 1012 { 1013 MIN_ARGS( 2 ); 1014 1015 cmd_set_real( irc, cmd + 1, cmd_chat_set_findhead, NULL ); 1016 } 1017 else if( g_strcasecmp( cmd[1], "del" ) == 0 ) 1018 { 1019 MIN_ARGS( 2 ); 1020 1021 if( ( c = chat_get( irc, cmd[2] ) ) ) 1022 { 1023 chat_del( irc, c ); 1024 } 1025 else 1026 { 1027 irc_usermsg( irc, "Could not remove chat." ); 1028 } 1029 } 982 ic->data = igs = g_new0( struct irc_groupchat_stub, 1 ); 983 igs->acc = acc; 984 igs->room = g_strdup( cmd[3] ); 985 } 986 } 987 /* 1030 988 else if( g_strcasecmp( cmd[1], "with" ) == 0 ) 1031 989 { … … 1047 1005 } 1048 1006 } 1007 */ 1049 1008 else 1050 1009 { … … 1052 1011 } 1053 1012 } 1054 #endif1055 1013 1056 1014 static void cmd_transfer( irc_t *irc, char **cmd ) … … 1137 1095 { "transfer", 0, cmd_transfer, 0 }, 1138 1096 { "yes", 0, cmd_yesno, 0 }, 1139 #if 01140 1097 { "chat", 1, cmd_chat, 0 }, 1141 #endif1142 1098 { NULL } 1143 1099 };
Note: See TracChangeset
for help on using the changeset viewer.