Changes in root_commands.c [9334cc2:9da0bbf]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r9334cc2 r9da0bbf 383 383 } 384 384 385 if( cmd[3] && set_name)385 if( cmd[3] ) 386 386 { 387 387 set_t *s = set_find( &a->set, set_name ); … … 912 912 if( cmd[3] ) 913 913 { 914 channel = g_strdup( cmd[3] ); 914 if( cmd[3][0] != '#' && cmd[3][0] != '&' ) 915 channel = g_strdup_printf( "&%s", cmd[3] ); 916 else 917 channel = g_strdup( cmd[3] ); 915 918 } 916 919 else … … 918 921 char *s; 919 922 920 channel = g_strdup (chat );923 channel = g_strdup_printf( "&%s", chat ); 921 924 if( ( s = strchr( channel, '@' ) ) ) 922 925 *s = 0; … … 924 927 if( cmd[3] && cmd[4] ) 925 928 nick = cmd[4]; 929 else 930 nick = irc->nick; 926 931 if( cmd[3] && cmd[4] && cmd[5] ) 927 932 password = cmd[5]; 928 933 929 c = a->prpl->chat_join( ic, chat, nick, password ); 930 931 g_free( channel ); 934 if( !nick_ok( channel + 1 ) ) 935 { 936 irc_usermsg( irc, "Invalid channel name: %s", channel ); 937 g_free( channel ); 938 return; 939 } 940 else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) ) 941 { 942 irc_usermsg( irc, "Channel already exists: %s", channel ); 943 g_free( channel ); 944 return; 945 } 946 947 if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) ) 948 { 949 g_free( c->channel ); 950 c->channel = channel; 951 } 952 else 953 { 954 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" ); 955 g_free( channel ); 956 } 932 957 } 933 958
Note: See TracChangeset
for help on using the changeset viewer.