comparison libpurple/protocols/oscar/oscar.c @ 18613:c5be17bbb6e4

Get rid of a crash that happens when signing off if you have a chat room open
author Mark Doliner <mark@kingant.net>
date Sun, 22 Jul 2007 08:54:03 +0000
parents 43a331f88c68
children 3f0204c58dfa 974f9298814c
comparison
equal deleted inserted replaced
18611:43a331f88c68 18613:c5be17bbb6e4
1429 1429
1430 static void 1430 static void
1431 purple_parse_auth_securid_request_no_cb(gpointer user_data, const char *value) 1431 purple_parse_auth_securid_request_no_cb(gpointer user_data, const char *value)
1432 { 1432 {
1433 PurpleConnection *gc = user_data; 1433 PurpleConnection *gc = user_data;
1434 OscarData *od = gc->proto_data;
1435 1434
1436 /* Disconnect */ 1435 /* Disconnect */
1437 gc->wants_to_die = TRUE; 1436 gc->wants_to_die = TRUE;
1438 purple_connection_error(gc, _("The SecurID key entered is invalid.")); 1437 purple_connection_error(gc, _("The SecurID key entered is invalid."));
1439 } 1438 }
3471 3470
3472 g_return_val_if_fail(conn != NULL, 1); 3471 g_return_val_if_fail(conn != NULL, 1);
3473 3472
3474 if (conn->type == SNAC_FAMILY_CHAT) { 3473 if (conn->type == SNAC_FAMILY_CHAT) {
3475 struct chat_connection *cc; 3474 struct chat_connection *cc;
3476 PurpleConversation *conv; 3475 PurpleConversation *conv = NULL;
3477 3476
3478 cc = find_oscar_chat_by_conn(gc, conn); 3477 cc = find_oscar_chat_by_conn(gc, conn);
3479 conv = purple_find_chat(gc, cc->id); 3478 if (cc != NULL)
3480
3481 if (conv != NULL)
3482 { 3479 {
3483 /* 3480 conv = purple_find_chat(gc, cc->id);
3484 * TOOD: Have flap_connection_destroy_cb() send us the 3481
3485 * error message stored in 'tmp', which should be 3482 if (conv != NULL)
3486 * human-friendly, and print that to the chat room. 3483 {
3487 */ 3484 /*
3488 gchar *buf; 3485 * TOOD: Have flap_connection_destroy_cb() send us the
3489 buf = g_strdup_printf(_("You have been disconnected from chat " 3486 * error message stored in 'tmp', which should be
3490 "room %s."), cc->name); 3487 * human-friendly, and print that to the chat room.
3491 purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL)); 3488 */
3492 g_free(buf); 3489 gchar *buf;
3493 } 3490 buf = g_strdup_printf(_("You have been disconnected from chat "
3494 oscar_chat_kill(gc, cc); 3491 "room %s."), cc->name);
3492 purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL));
3493 g_free(buf);
3494 }
3495 oscar_chat_kill(gc, cc);
3496 }
3495 } 3497 }
3496 3498
3497 return 1; 3499 return 1;
3498 } 3500 }
3499 3501