Changes in root_commands.c [449a51d:2ea8736]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r449a51d r2ea8736 29 29 #include "bitlbee.h" 30 30 #include "help.h" 31 #include "chat.h"32 31 33 32 #include <string.h> … … 143 142 storage_status_t status = storage_load( irc, cmd[1] ); 144 143 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 }151 144 152 145 switch (status) { … … 914 907 online = 1; 915 908 else 916 online = away = 1;909 online = away = 1; 917 910 918 911 if( strchr( irc->umode, 'b' ) != NULL ) … … 927 920 if( online == 1 ) 928 921 { 929 char st[256] = "Online";930 931 if( u->status_msg )932 g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg );933 934 922 g_snprintf( s, sizeof( s ) - 1, "%s@%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name, u->ic->acc->user ); 935 irc_usermsg( irc, format, u->nick, s, st);923 irc_usermsg( irc, format, u->nick, s, "Online" ); 936 924 } 937 925 … … 1126 1114 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); 1127 1115 } 1116 1117 1118 1119 #if 0 1120 account_t *a; 1121 struct im_connection *ic; 1122 char *chat, *channel, *nick = NULL, *password = NULL; 1123 struct groupchat *c; 1124 1125 if( !( a = account_get( irc, cmd[1] ) ) ) 1126 { 1127 irc_usermsg( irc, "Invalid account" ); 1128 return; 1129 } 1130 else if( !( a->ic && ( a->ic->flags & OPT_LOGGED_IN ) ) ) 1131 { 1132 irc_usermsg( irc, "That account is not on-line" ); 1133 return; 1134 } 1135 else if( a->prpl->chat_join == NULL ) 1136 { 1137 irc_usermsg( irc, "Command `%s' not supported by this protocol", cmd[0] ); 1138 return; 1139 } 1140 ic = a->ic; 1141 1142 chat = cmd[2]; 1143 if( cmd[3] ) 1144 { 1145 if( strchr( CTYPES, cmd[3][0] ) == NULL ) 1146 channel = g_strdup_printf( "&%s", cmd[3] ); 1147 else 1148 channel = g_strdup( cmd[3] ); 1149 } 1150 else 1151 { 1152 char *s; 1153 1154 channel = g_strdup_printf( "&%s", chat ); 1155 if( ( s = strchr( channel, '@' ) ) ) 1156 *s = 0; 1157 } 1158 if( cmd[3] && cmd[4] ) 1159 nick = cmd[4]; 1160 else 1161 nick = irc->nick; 1162 if( cmd[3] && cmd[4] && cmd[5] ) 1163 password = cmd[5]; 1164 1165 if( !nick_ok( channel + 1 ) ) 1166 { 1167 irc_usermsg( irc, "Invalid channel name: %s", channel ); 1168 g_free( channel ); 1169 return; 1170 } 1171 else if( g_strcasecmp( channel, irc->channel ) == 0 || irc_chat_by_channel( irc, channel ) ) 1172 { 1173 irc_usermsg( irc, "Channel already exists: %s", channel ); 1174 g_free( channel ); 1175 return; 1176 } 1177 1178 if( ( c = a->prpl->chat_join( ic, chat, nick, password ) ) ) 1179 { 1180 g_free( c->channel ); 1181 c->channel = channel; 1182 } 1183 else 1184 { 1185 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" ); 1186 g_free( channel ); 1187 } 1188 #endif 1128 1189 } 1129 1190
Note: See TracChangeset
for help on using the changeset viewer.