changeset 17426:27ee01859e9a

disapproval of revision '882bec7b9240768133433a448e9ff4e31e130832'
author Richard Laager <rlaager@wiktel.com>
date Sat, 02 Jun 2007 04:34:56 +0000
parents 3f11fad07eda
children 7b8725f898b3
files libpurple/dbus-bindings.h libpurple/dbus-server.c libpurple/status.c
diffstat 3 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dbus-bindings.h	Sat Jun 02 03:46:40 2007 +0000
+++ b/libpurple/dbus-bindings.h	Sat Jun 02 04:34:56 2007 +0000
@@ -35,9 +35,9 @@
 extern "C" {
 #endif
 
-gint purple_dbus_pointer_to_id(gconstpointer node);
+gint purple_dbus_pointer_to_id(gpointer node);
 gpointer purple_dbus_id_to_pointer(gint id, PurpleDBusType *type);
-gint  purple_dbus_pointer_to_id_error(gconstpointer ptr, DBusError *error);
+gint  purple_dbus_pointer_to_id_error(gpointer ptr, DBusError *error);
 gpointer purple_dbus_id_to_pointer_error(gint id, PurpleDBusType *type,
 				       const char *typename, DBusError *error);
 
--- a/libpurple/dbus-server.c	Sat Jun 02 03:46:40 2007 +0000
+++ b/libpurple/dbus-server.c	Sat Jun 02 04:34:56 2007 +0000
@@ -108,7 +108,7 @@
 }
 
 gint
-purple_dbus_pointer_to_id(gconstpointer node)
+purple_dbus_pointer_to_id(gpointer node)
 {
 	gint id = GPOINTER_TO_INT(g_hash_table_lookup(map_node_id, node));
 	if ((id == 0) && (node != NULL))
@@ -138,7 +138,7 @@
 }
 
 gint
-purple_dbus_pointer_to_id_error(gconstpointer ptr, DBusError *error)
+purple_dbus_pointer_to_id_error(gpointer ptr, DBusError *error)
 {
 	gint id = purple_dbus_pointer_to_id(ptr);
 
--- a/libpurple/status.c	Sat Jun 02 03:46:40 2007 +0000
+++ b/libpurple/status.c	Sat Jun 02 04:34:56 2007 +0000
@@ -1275,7 +1275,6 @@
 purple_presence_set_idle(PurplePresence *presence, gboolean idle, time_t idle_time)
 {
 	gboolean old_idle;
-	time_t current_time;
 
 	g_return_if_fail(presence != NULL);
 
@@ -1286,14 +1285,14 @@
 	presence->idle      = idle;
 	presence->idle_time = (idle ? idle_time : 0);
 
-	current_time = time(NULL);
-
 	if (purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_BUDDY)
 	{
+		time_t current_time = time(NULL);
+
 		update_buddy_idle(purple_presence_get_buddy(presence), presence, current_time,
-		                  old_idle, idle);
+		old_idle, idle);
 	}
-	else if (purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_ACCOUNT)
+	else if(purple_presence_get_context(presence) == PURPLE_PRESENCE_CONTEXT_ACCOUNT)
 	{
 		PurpleAccount *account;
 		PurpleConnection *gc;
@@ -1313,10 +1312,9 @@
 					msg = g_strdup_printf(_("+++ %s became idle"), purple_account_get_username(account));
 				else
 					msg = g_strdup_printf(_("+++ %s became unidle"), purple_account_get_username(account));
-
 				purple_log_write(log, PURPLE_MESSAGE_SYSTEM,
-				                 purple_account_get_username(account),
-				                 (idle ? idle_time : current_time), msg);
+							   purple_account_get_username(account),
+							   idle_time, msg);
 				g_free(msg);
 			}
 		}
@@ -1328,7 +1326,7 @@
 			prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
 
 		if (prpl_info && prpl_info->set_idle)
-			prpl_info->set_idle(gc, (idle ? (current_time - idle_time) : 0));
+			prpl_info->set_idle(gc, (idle ? (time(NULL) - idle_time) : 0));
 	}
 }