comparison libpurple/protocols/jabber/buddy.c @ 27014:a8537bbcfb79

Remove trailing whitespace that has snuck in.
author Paul Aurich <paul@darkrain42.org>
date Fri, 22 May 2009 03:54:29 +0000
parents 56460ebd1558
children bc2aa262a567
comparison
equal deleted inserted replaced
27013:6105fa42b60c 27014:a8537bbcfb79
1042 } 1042 }
1043 } 1043 }
1044 1044
1045 if (!jbi->jb->resources) { 1045 if (!jbi->jb->resources) {
1046 /* the buddy is offline */ 1046 /* the buddy is offline */
1047 gchar *status = 1047 gchar *status =
1048 g_strdup_printf("%s%s%s", _("Offline"), 1048 g_strdup_printf("%s%s%s", _("Offline"),
1049 jbi->last_message ? ": " : "", 1049 jbi->last_message ? ": " : "",
1050 jbi->last_message ? jbi->last_message : ""); 1050 jbi->last_message ? jbi->last_message : "");
1051 if (jbi->last_seconds > 0) { 1051 if (jbi->last_seconds > 0) {
1052 char *last = purple_str_seconds_to_string(jbi->last_seconds); 1052 char *last = purple_str_seconds_to_string(jbi->last_seconds);
1053 gchar *message = g_strdup_printf(_("%s ago"), last); 1053 gchar *message = g_strdup_printf(_("%s ago"), last);
1054 purple_notify_user_info_prepend_pair(user_info, 1054 purple_notify_user_info_prepend_pair(user_info,
1055 _("Logged off"), message); 1055 _("Logged off"), message);
1056 g_free(last); 1056 g_free(last);
1057 g_free(message); 1057 g_free(message);
1058 } 1058 }
1059 purple_notify_user_info_prepend_pair(user_info, _("Status"), status); 1059 purple_notify_user_info_prepend_pair(user_info, _("Status"), status);
1469 JabberBuddyInfoResource *jbir = g_hash_table_lookup(jbi->resources, resource_name); 1469 JabberBuddyInfoResource *jbir = g_hash_table_lookup(jbi->resources, resource_name);
1470 if(jbir) { 1470 if(jbir) {
1471 jbir->idle_seconds = sec; 1471 jbir->idle_seconds = sec;
1472 } 1472 }
1473 } 1473 }
1474 /* Update the idle time of the buddy resource, if we got it. 1474 /* Update the idle time of the buddy resource, if we got it.
1475 This will correct the value when a server doesn't mark 1475 This will correct the value when a server doesn't mark
1476 delayed presence and we got the presence when signing on */ 1476 delayed presence and we got the presence when signing on */
1477 jb = jabber_buddy_find(js, from, FALSE); 1477 jb = jabber_buddy_find(js, from, FALSE);
1478 if (jb) { 1478 if (jb) {
1479 resource = jabber_get_resource(from); 1479 resource = jabber_get_resource(from);
1480 buddy_name = jabber_get_bare_jid(from); 1480 buddy_name = jabber_get_bare_jid(from);
1491 jbr->idle = time(NULL) - sec; 1491 jbr->idle = time(NULL) - sec;
1492 } else { 1492 } else {
1493 jbr->idle = 0; 1493 jbr->idle = 0;
1494 } 1494 }
1495 1495
1496 if (jbr == 1496 if (jbr ==
1497 jabber_buddy_find_resource(jb, NULL)) { 1497 jabber_buddy_find_resource(jb, NULL)) {
1498 purple_prpl_got_user_idle(js->gc->account, 1498 purple_prpl_got_user_idle(js->gc->account,
1499 buddy_name, jbr->idle, jbr->idle); 1499 buddy_name, jbr->idle, jbr->idle);
1500 } 1500 }
1501 } 1501 }
1502 } 1502 }
1503 } 1503 }
1748 xmlnode_set_attrib(iq->node, "to", jid); 1748 xmlnode_set_attrib(iq->node, "to", jid);
1749 jabber_iq_set_callback(iq, jabber_last_offline_parse, jbi); 1749 jabber_iq_set_callback(iq, jabber_last_offline_parse, jbi);
1750 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); 1750 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id));
1751 jabber_iq_send(iq); 1751 jabber_iq_send(iq);
1752 } 1752 }
1753 1753
1754 js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi); 1754 js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi);
1755 jbi->timeout_handle = purple_timeout_add_seconds(30, jabber_buddy_get_info_timeout, jbi); 1755 jbi->timeout_handle = purple_timeout_add_seconds(30, jabber_buddy_get_info_timeout, jbi);
1756 } 1756 }
1757 1757
1758 void jabber_buddy_get_info(PurpleConnection *gc, const char *who) 1758 void jabber_buddy_get_info(PurpleConnection *gc, const char *who)
2499 2499
2500 /* TODO: Are these messages actually useful? */ 2500 /* TODO: Are these messages actually useful? */
2501 if (node) 2501 if (node)
2502 purple_debug_info("jabber", "Found cap: %s\n", cap); 2502 purple_debug_info("jabber", "Found cap: %s\n", cap);
2503 else 2503 else
2504 purple_debug_info("jabber", "Cap %s not found\n", cap); 2504 purple_debug_info("jabber", "Cap %s not found\n", cap);
2505 2505
2506 return (node != NULL); 2506 return (node != NULL);
2507 } 2507 }
2508 2508
2509 gboolean 2509 gboolean