Mercurial > pidgin.yaz
diff src/protocols/oscar/oscar.c @ 8308:34e8ad866f12
[gaim-migrate @ 9032]
Bring back the meaningless join chat icon on the join chat button in
the join chat dialog. Hip hip, hoorah!
Also give an error in oscar if trying to join a chat with no name.
And rename g to gc in a few places.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 21 Feb 2004 07:25:58 +0000 |
parents | ef881489396e |
children | fec4c1fb2ac8 |
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c Sat Feb 21 07:01:42 2004 +0000 +++ b/src/protocols/oscar/oscar.c Sat Feb 21 07:25:58 2004 +0000 @@ -5363,8 +5363,8 @@ return m; } -static void oscar_join_chat(GaimConnection *g, GHashTable *data) { - OscarData *od = (OscarData *)g->proto_data; +static void oscar_join_chat(GaimConnection *gc, GHashTable *data) { + OscarData *od = (OscarData *)gc->proto_data; aim_conn_t *cur; char *name, *exchange; @@ -5373,6 +5373,12 @@ gaim_debug(GAIM_DEBUG_INFO, "oscar", "Attempting to join chat room %s.\n", name); + + if ((name == NULL) || (*name == '\0')) { + gaim_notify_error(gc, NULL, _("Invalid chat name specified."), NULL); + return; + } + if ((cur = aim_getconn_type(od->sess, AIM_CONN_TYPE_CHATNAV))) { gaim_debug(GAIM_DEBUG_INFO, "oscar", "chatnav exists, creating room\n"); @@ -5389,9 +5395,9 @@ } } -static void oscar_chat_invite(GaimConnection *g, int id, const char *message, const char *name) { - OscarData *od = (OscarData *)g->proto_data; - struct chat_connection *ccon = find_oscar_chat(g, id); +static void oscar_chat_invite(GaimConnection *gc, int id, const char *message, const char *name) { + OscarData *od = (OscarData *)gc->proto_data; + struct chat_connection *ccon = find_oscar_chat(gc, id); if (!ccon) return; @@ -5400,9 +5406,9 @@ ccon->exchange, ccon->name, 0x0); } -static void oscar_chat_leave(GaimConnection *g, int id) { - OscarData *od = g ? (OscarData *)g->proto_data : NULL; - GSList *bcs = g->buddy_chats; +static void oscar_chat_leave(GaimConnection *gc, int id) { + OscarData *od = gc ? (OscarData *)gc->proto_data : NULL; + GSList *bcs = gc->buddy_chats; GaimConversation *b = NULL; struct chat_connection *c = NULL; int count = 0; @@ -5422,20 +5428,20 @@ gaim_debug(GAIM_DEBUG_INFO, "oscar", "Attempting to leave room %s (currently in %d rooms)\n", b->name, count); - c = find_oscar_chat(g, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b))); + c = find_oscar_chat(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b))); if (c != NULL) { if (od) od->oscar_chats = g_slist_remove(od->oscar_chats, c); if (c->inpa > 0) gaim_input_remove(c->inpa); - if (g && od->sess) + if (gc && od->sess) aim_conn_kill(od->sess, &c->conn); g_free(c->name); g_free(c->show); g_free(c); } /* we do this because with Oscar it doesn't tell us we left */ - serv_got_chat_left(g, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b))); + serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b))); } static int oscar_send_chat(GaimConnection *gc, int id, const char *message) {