Changeset 256899f for root_commands.c
- Timestamp:
- 2007-11-19T23:16:18Z (16 years ago)
- Branches:
- master
- Children:
- 7df5a08
- Parents:
- cd428e4 (diff), ef5c185 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
rcd428e4 r256899f 930 930 if( cmd[3] ) 931 931 { 932 channel = g_strdup( cmd[3] ); 932 if( cmd[3][0] != '#' && cmd[3][0] != '&' ) 933 channel = g_strdup_printf( "&%s", cmd[3] ); 934 else 935 channel = g_strdup( cmd[3] ); 933 936 } 934 937 else … … 936 939 char *s; 937 940 938 channel = g_strdup (chat );941 channel = g_strdup_printf( "&%s", chat ); 939 942 if( ( s = strchr( channel, '@' ) ) ) 940 943 *s = 0; … … 942 945 if( cmd[3] && cmd[4] ) 943 946 nick = cmd[4]; 947 else 948 nick = irc->nick; 944 949 if( cmd[3] && cmd[4] && cmd[5] ) 945 950 password = cmd[5]; 946 951 947 c = a->prpl->chat_join( ic, chat, nick, password ); 948 949 g_free( channel ); 952 if( !nick_ok( channel + 1 ) ) 953 { 954 irc_usermsg( irc, "Invalid channel name: %s", channel ); 955 g_free( channel ); 956 return; 957 } 958 else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) ) 959 { 960 irc_usermsg( irc, "Channel already exists: %s", channel ); 961 g_free( channel ); 962 return; 963 } 964 965 if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) ) 966 { 967 g_free( c->channel ); 968 c->channel = channel; 969 } 970 else 971 { 972 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" ); 973 g_free( channel ); 974 } 950 975 } 951 976
Note: See TracChangeset
for help on using the changeset viewer.