diff src/server.c @ 11907:d2db6426c88a

[gaim-migrate @ 14198] sf patch #1342817, from Evan Schoenberg "As discussed in #gaim, this patch removes idle.c and replaces it with gtkidle.c and gtkidle.h. The attached diff removes the idle management from its various hiding places in connection.c, server.c, and gaim.h. The plugins Changelog.API is appropriately updated. The new gtkidle files are attached; idle.c should be removed from CVS." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 30 Oct 2005 23:00:47 +0000
parents c9312177821a
children aadf61b30056
line wrap: on
line diff
--- a/src/server.c	Sun Oct 30 20:20:38 2005 +0000
+++ b/src/server.c	Sun Oct 30 23:00:47 2005 +0000
@@ -41,18 +41,6 @@
 #define SECS_BEFORE_RESENDING_AUTORESPONSE 600
 #define SEX_BEFORE_RESENDING_AUTORESPONSE "Only after you're married"
 
-void serv_touch_idle(GaimConnection *gc)
-{
-	/* Are we idle?  If so, not anymore */
-	if (gc->is_idle > 0) {
-		gc->is_idle = 0;
-		serv_set_idle(gc, 0);
-	}
-	time(&gc->last_sent_time);
-	if (gc->is_auto_away)
-		check_idle(gc);
-}
-
 /* This should return the elapsed time in seconds in which Gaim will not send
  * typing notifications.
  * if it returns zero, it will not send any more typing notifications
@@ -149,8 +137,9 @@
 	if (prpl_info && prpl_info->send_im)
 		val = prpl_info->send_im(gc, name, message, imflags);
 
+	/* Only update the last_sent_time if the user actually sent the message */
 	if (!(imflags & GAIM_CONV_IM_AUTO_RESP))
-		serv_touch_idle(gc);
+		time(&gc->last_sent_time);
 
 	/*
 	 * XXX - If "only auto-reply when away & idle" is set, then shouldn't
@@ -428,18 +417,18 @@
 		prpl_info->chat_whisper(g, id, who, message);
 }
 
-int serv_chat_send(GaimConnection *g, int id, const char *message)
+int serv_chat_send(GaimConnection *gc, int id, const char *message)
 {
 	int val = -EINVAL;
 	GaimPluginProtocolInfo *prpl_info = NULL;
 
-	if (g->prpl != NULL)
-		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
+	if (gc->prpl != NULL)
+		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
 
 	if (prpl_info && prpl_info->chat_send)
-		val = prpl_info->chat_send(g, id, message);
+		val = prpl_info->chat_send(gc, id, message);
 
-	serv_touch_idle(g);
+	time(&gc->last_sent_time);
 
 	return val;
 }