Mercurial > pidgin
diff src/server.c @ 10011:32467b63f55a
[gaim-migrate @ 10928]
More deprecation of serv_got_update or whatever it's called.
Is all the sound and logging stuff done in the new code? I didn't
actually check.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 11 Sep 2004 03:37:16 +0000 |
parents | bdec08a8fc5b |
children | eaec201b2688 |
line wrap: on
line diff
--- a/src/server.c Fri Sep 10 22:39:35 2004 +0000 +++ b/src/server.c Sat Sep 11 03:37:16 2004 +0000 @@ -1053,133 +1053,6 @@ g_free(message); } -/* - * @param idle The time at which the buddy became idle, in seconds - * since the epoch. - */ -void serv_got_update(GaimConnection *gc, const char *name, gboolean loggedin, - time_t signon) -{ - GaimPresence *presence; - GaimAccount *account; - GaimConversation *c; - GaimBuddy *b; - char *alias; - GSList *buddies; - time_t current_time = time(NULL); - int signing_on = 0; - int signing_off = 0; - - account = gaim_connection_get_account(gc); - b = gaim_find_buddy(account, name); - - if (!b) { - gaim_debug(GAIM_DEBUG_ERROR, "server", "No such buddy: %s\n", name); - return; - } - - c = gaim_find_conversation_with_account(b->name, account); - - /* This code will 'align' the name from the TOC */ - /* server with what's in our record. We want to */ - /* store things how THEY want it... */ - if (strcmp(name, b->name)) { - gaim_blist_rename_buddy(b, name); - } - - alias = gaim_escape_html(gaim_buddy_get_alias(b)); - - presence = gaim_buddy_get_presence(b); - - if (loggedin) { - if (!GAIM_BUDDY_IS_ONLINE(b)) { - signing_on = TRUE; - } - } else if (GAIM_BUDDY_IS_ONLINE(b)) { - signing_off = TRUE; - } - - - if (signing_on) { - if (c != NULL) { - char *tmp = g_strdup_printf(_("%s logged in."), alias); - - gaim_conversation_write(c, NULL, tmp, GAIM_MESSAGE_SYSTEM, - time(NULL)); - g_free(tmp); - } -#if 0 - else if (awayqueue && find_queue_total_by_name(b->name)) { - struct queued_message *qm = g_new0(struct queued_message, 1); - g_snprintf(qm->name, sizeof(qm->name), "%s", b->name); - qm->message = g_strdup_printf(_("%s logged in."), alias); - qm->account = gc->account; - qm->tm = time(NULL); - qm->flags = GAIM_MESSAGE_SYSTEM; - message_queue = g_slist_append(message_queue, qm); - } -#endif - gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); - - if(gaim_prefs_get_bool("/core/logging/log_system") && - gaim_prefs_get_bool("/core/logging/log_signon_signoff")) { - GaimAccount *account = gaim_connection_get_account(gc); - GaimLog *log = gaim_account_get_log(account); - char *tmp = g_strdup_printf(_("%s signed on"), alias); - - gaim_log_write(log, GAIM_MESSAGE_SYSTEM, (alias ? alias : name), - current_time, tmp); - g_free(tmp); - } - } - - if (signing_off) { - if (c != NULL) { - char *tmp = g_strdup_printf(_("%s logged out."), alias); - gaim_conversation_write(c, NULL, tmp, - GAIM_MESSAGE_SYSTEM, time(NULL)); - g_free(tmp); - } -#if 0 - else if (awayqueue && find_queue_total_by_name(b->name)) { - struct queued_message *qm = g_new0(struct queued_message, 1); - g_snprintf(qm->name, sizeof(qm->name), "%s", b->name); - qm->message = g_strdup_printf(_("%s logged out."), alias); - qm->account = gc->account; - qm->tm = time(NULL); - qm->flags = GAIM_MESSAGE_SYSTEM; - message_queue = g_slist_append(message_queue, qm); - } -#endif - serv_got_typing_stopped(gc, name); /* obviously not typing */ - gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); - - if(gaim_prefs_get_bool("/core/logging/log_system") && - gaim_prefs_get_bool("/core/logging/log_signon_signoff")) { - GaimAccount *account = gaim_connection_get_account(gc); - GaimLog *log = gaim_account_get_log(account); - char *tmp = g_strdup_printf(_("%s signed off"), alias); - - gaim_log_write(log, GAIM_MESSAGE_SYSTEM, (alias ? alias : name), - current_time, tmp); - g_free(tmp); - } - } - - gaim_blist_update_buddy_signon(b, signon); - - if (c != NULL) - gaim_conversation_update(c, GAIM_CONV_UPDATE_AWAY); - - gaim_blist_update_buddy_presence(b, loggedin); - - for (buddies = gaim_find_buddies(account, name); buddies; buddies = g_slist_remove(buddies, buddies->data)) { - b = buddies->data; - gaim_blist_update_buddy_presence(b, loggedin); - } - g_free(alias); -} - void serv_got_typing(GaimConnection *gc, const char *name, int timeout, GaimTypingState state) {