comparison libpurple/protocols/oscar/oscar.c @ 18609:2774acdb1cff

Move a call to purple_connection_error() from oscar.c to flap_connection.c, where it makes more sense.
author Mark Doliner <mark@kingant.net>
date Sun, 22 Jul 2007 08:28:55 +0000
parents a244c34ce59c
children 43a331f88c68
comparison
equal deleted inserted replaced
18608:a244c34ce59c 18609:2774acdb1cff
3472 purple_debug_info("oscar", "Disconnected. Code is 0x%04x and msg is %s\n", 3472 purple_debug_info("oscar", "Disconnected. Code is 0x%04x and msg is %s\n",
3473 code, (msg != NULL ? msg : "")); 3473 code, (msg != NULL ? msg : ""));
3474 3474
3475 g_return_val_if_fail(conn != NULL, 1); 3475 g_return_val_if_fail(conn != NULL, 1);
3476 3476
3477 if (conn->type == SNAC_FAMILY_LOCATE) { 3477 if (conn->type == SNAC_FAMILY_CHAT) {
3478 if (code == 0x0001) {
3479 gc->wants_to_die = TRUE;
3480 purple_connection_error(gc, _("You have signed on from another location."));
3481 } else {
3482 purple_connection_error(gc, _("You have been signed off for an unknown reason."));
3483 }
3484 od->killme = TRUE;
3485 } else if (conn->type == SNAC_FAMILY_CHAT) {
3486 struct chat_connection *cc; 3478 struct chat_connection *cc;
3487 PurpleConversation *conv; 3479 PurpleConversation *conv;
3488 3480
3489 cc = find_oscar_chat_by_conn(gc, conn); 3481 cc = find_oscar_chat_by_conn(gc, conn);
3490 conv = purple_find_chat(gc, cc->id); 3482 conv = purple_find_chat(gc, cc->id);
3491 3483
3492 if (conv != NULL) 3484 if (conv != NULL)
3493 { 3485 {
3486 /*
3487 * TOOD: Have flap_connection_destroy_cb() send us the
3488 * error message stored in 'tmp', which should be
3489 * human-friendly, and print that to the chat room.
3490 */
3494 gchar *buf; 3491 gchar *buf;
3495 buf = g_strdup_printf(_("You have been disconnected from chat " 3492 buf = g_strdup_printf(_("You have been disconnected from chat "
3496 "room %s."), cc->name); 3493 "room %s."), cc->name);
3497 purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL)); 3494 purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL));
3498 g_free(buf); 3495 g_free(buf);