comparison src/protocols/irc/irc.c @ 6752:90fd056e755d

[gaim-migrate @ 7284] disallow spaces in nicks committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Fri, 05 Sep 2003 16:52:43 +0000
parents 0c5637b5462e
children faa491042c66
comparison
equal deleted inserted replaced
6751:35b01b371785 6752:90fd056e755d
139 const char *username = gaim_account_get_username(account); 139 const char *username = gaim_account_get_username(account);
140 int err; 140 int err;
141 141
142 gc = gaim_account_get_connection(account); 142 gc = gaim_account_get_connection(account);
143 143
144 if (strpbrk(username, " \t\v\r\n") != NULL) {
145 gaim_connection_error(gc, _("IRC nicks may not contain whitespace"));
146 return;
147 }
148
144 gc->proto_data = irc = g_new0(struct irc_conn, 1); 149 gc->proto_data = irc = g_new0(struct irc_conn, 1);
145 irc->account = account; 150 irc->account = account;
146 151
147 userparts = g_strsplit(username, "@", 2); 152 userparts = g_strsplit(username, "@", 2);
148 gaim_connection_set_display_name(gc, userparts[0]); 153 gaim_connection_set_display_name(gc, userparts[0]);
217 } 222 }
218 223
219 static void irc_close(GaimConnection *gc) 224 static void irc_close(GaimConnection *gc)
220 { 225 {
221 struct irc_conn *irc = gc->proto_data; 226 struct irc_conn *irc = gc->proto_data;
227
228 if (irc == NULL)
229 return;
222 230
223 irc_cmd_quit(irc, "quit", NULL, NULL); 231 irc_cmd_quit(irc, "quit", NULL, NULL);
224 232
225 if (gc->inpa) 233 if (gc->inpa)
226 g_source_remove(gc->inpa); 234 g_source_remove(gc->inpa);