Changeset 3330468 for root_commands.c


Ignore:
Timestamp:
2010-03-14T23:15:05Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
81ee561
Parents:
7c5affca (diff), 7e2b593 (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.
Message:

Merging in head.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r7c5affca r3330468  
    143143        storage_status_t status = storage_load( irc, cmd[1] );
    144144        char *account_on[] = { "account", "on", NULL };
     145       
     146        if( strchr( irc->umode, 'R' ) != NULL )
     147        {
     148                irc_usermsg( irc, "You're already logged in." );
     149                return;
     150        }
    145151       
    146152        switch (status) {
     
    11151121                irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] );
    11161122        }
    1117 
    1118 
    1119 
    1120 #if 0
    1121         account_t *a;
    1122         struct im_connection *ic;
    1123         char *chat, *channel, *nick = NULL, *password = NULL;
    1124         struct groupchat *c;
    1125        
    1126         if( !( a = account_get( irc, cmd[1] ) ) )
    1127         {
    1128                 irc_usermsg( irc, "Invalid account" );
    1129                 return;
    1130         }
    1131         else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) )
    1132         {
    1133                 irc_usermsg( irc, "That account is not on-line" );
    1134                 return;
    1135         }
    1136         else if( a->prpl->chat_join == NULL )
    1137         {
    1138                 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] );
    1139                 return;
    1140         }
    1141         ic = a->ic;
    1142        
    1143         chat = cmd[2];
    1144         if( cmd[3] )
    1145         {
    1146                 if( strchr( CTYPES, cmd[3][0] ) == NULL )
    1147                         channel = g_strdup_printf( "&%s", cmd[3] );
    1148                 else
    1149                         channel = g_strdup( cmd[3] );
    1150         }
    1151         else
    1152         {
    1153                 char *s;
    1154                
    1155                 channel = g_strdup_printf( "&%s", chat );
    1156                 if( ( s = strchr( channel, '@' ) ) )
    1157                         *s = 0;
    1158         }
    1159         if( cmd[3] && cmd[4] )
    1160                 nick = cmd[4];
    1161         else
    1162                 nick = irc->nick;
    1163         if( cmd[3] && cmd[4] && cmd[5] )
    1164                 password = cmd[5];
    1165        
    1166         if( !nick_ok( channel + 1 ) )
    1167         {
    1168                 irc_usermsg( irc, "Invalid channel name: %s", channel );
    1169                 g_free( channel );
    1170                 return;
    1171         }
    1172         else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) )
    1173         {
    1174                 irc_usermsg( irc, "Channel already exists: %s", channel );
    1175                 g_free( channel );
    1176                 return;
    1177         }
    1178        
    1179         if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) )
    1180         {
    1181                 g_free( c->channel );
    1182                 c->channel = channel;
    1183         }
    1184         else
    1185         {
    1186                 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" );
    1187                 g_free( channel );
    1188         }
    1189 #endif
    11901123}
    11911124
Note: See TracChangeset for help on using the changeset viewer.