Changeset a9a7287
- Timestamp:
- 2008-08-30T22:04:29Z (16 years ago)
- Branches:
- master
- Children:
- 131c6b6
- Parents:
- b84800d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
rb84800d ra9a7287 268 268 } 269 269 270 prpl = find_protocol( cmd[2]);270 prpl = find_protocol( cmd[2] ); 271 271 272 272 if( prpl == NULL ) … … 505 505 else 506 506 { 507 irc_usermsg( irc, "Unknown command: account %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[1] );507 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "account", cmd[1] ); 508 508 } 509 509 } … … 1003 1003 static void cmd_join_chat( irc_t *irc, char **cmd ) 1004 1004 { 1005 irc_usermsg( irc, "This command is now obsolete. " 1006 "Please try the `chat' command instead." ); 1007 } 1008 1009 static void cmd_chat( irc_t *irc, char **cmd ) 1010 { 1011 account_t *acc; 1012 struct chat *c; 1013 1014 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 1015 { 1016 if( !( cmd[2] && cmd[3] && cmd[4] ) ) 1017 { 1018 irc_usermsg( irc, "Not enough parameters given (need %d)", 4 ); 1019 return; 1020 } 1021 1022 if( !( acc = account_get( irc, cmd[2] ) ) ) 1023 { 1024 irc_usermsg( irc, "Invalid account" ); 1025 return; 1026 } 1027 1028 if( ( c = chat_add( irc, acc, cmd[3], cmd[4] ) ) ) 1029 irc_usermsg( irc, "Chatroom added successfully." ); 1030 else 1031 irc_usermsg( irc, "Could not add chatroom." ); 1032 } 1033 else if( g_strcasecmp( cmd[1], "list" ) == 0 ) 1034 { 1035 int i = 0; 1036 1037 if( strchr( irc->umode, 'b' ) ) 1038 irc_usermsg( irc, "Chatroom list:" ); 1039 1040 for( c = irc->chatrooms; c; c = c->next ) 1041 { 1042 irc_usermsg( irc, "%2d. %s(%s) %s, %s", i, c->acc->prpl->name, 1043 c->acc->user, c->handle, c->channel ); 1044 1045 i ++; 1046 } 1047 irc_usermsg( irc, "End of chatroom list" ); 1048 } 1049 else 1050 { 1051 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); 1052 } 1053 1054 1055 1056 #if 0 1005 1057 account_t *a; 1006 1058 struct im_connection *ic; … … 1071 1123 g_free( channel ); 1072 1124 } 1125 #endif 1073 1126 } 1074 1127 … … 1093 1146 { "qlist", 0, cmd_qlist, 0 }, 1094 1147 { "join_chat", 2, cmd_join_chat, 0 }, 1148 { "chat", 1, cmd_chat, 0 }, 1095 1149 { NULL } 1096 1150 };
Note: See TracChangeset
for help on using the changeset viewer.