Changeset 75554d0 for root_commands.c
- Timestamp:
- 2010-03-17T13:56:52Z (15 years ago)
- Branches:
- master
- Children:
- b788246
- Parents:
- e5e795d (diff), f9928cb (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
re5e795d r75554d0 143 143 storage_status_t status = storage_load( irc, cmd[1] ); 144 144 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 } 145 151 146 152 switch (status) { … … 908 914 online = 1; 909 915 else 910 online = 916 online = away = 1; 911 917 912 918 if( strchr( irc->umode, 'b' ) != NULL ) … … 921 927 if( online == 1 ) 922 928 { 929 char st[256] = "Online"; 930 931 if( u->status_msg ) 932 g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg ); 933 923 934 g_snprintf( s, sizeof( s ) - 1, "%s@%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name, u->ic->acc->user ); 924 irc_usermsg( irc, format, u->nick, s, "Online");935 irc_usermsg( irc, format, u->nick, s, st ); 925 936 } 926 937 … … 1115 1126 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] ); 1116 1127 } 1117 1118 1119 1120 #if 01121 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 else1149 channel = g_strdup( cmd[3] );1150 }1151 else1152 {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 else1162 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 else1185 {1186 irc_usermsg( irc, "Tried to join chat, not sure if this was successful" );1187 g_free( channel );1188 }1189 #endif1190 1128 } 1191 1129
Note: See TracChangeset
for help on using the changeset viewer.