changeset 12768:3f6f2d59bcb4

[gaim-migrate @ 15115] Changing the name of register_timeout to subscribe_timeout. Daniel pointed out that it is a wrong name, registered in the wrong place and spamming the debug log. committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Sun, 08 Jan 2006 22:26:30 +0000
parents 53218d758ba9
children a90255f67652
files src/protocols/simple/simple.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/simple/simple.c	Sun Jan 08 22:09:28 2006 +0000
+++ b/src/protocols/simple/simple.c	Sun Jan 08 22:26:30 2006 +0000
@@ -697,14 +697,13 @@
 	return TRUE;
 }
 
-static gboolean register_timeout(struct simple_account_data *sip) {
+static gboolean subscribe_timeout(struct simple_account_data *sip) {
 	GSList *tmp;
 	time_t curtime = time(NULL);
 	/* register again if first registration expires */
 	if(sip->reregister < curtime) {
 		do_register(sip);
 	}
-	gaim_debug_info("simple","in register timeout\n");
 	/* check for every subscription if we need to resubscribe */
 	g_hash_table_foreach(sip->buddies, (GHFunc)simple_buddy_resub, (gpointer)sip);
 
@@ -811,7 +810,7 @@
 			/* get buddies from blist */
 			simple_get_buddies(sip->gc);
 
-			register_timeout(sip);
+			subscribe_timeout(sip);
 			break;
 		case 401:
 			if(sip->registerstatus!=2) {
@@ -1182,6 +1181,8 @@
 	sip->fd = source;
 
 	conn = connection_create(sip, source);
+	
+	sip->registertimeout = gaim_timeout_add((rand()%100)+10*1000, (GSourceFunc)subscribe_timeout, sip);
 
 	do_register(sip);
 
@@ -1234,6 +1235,7 @@
 	sip->listenpa = gaim_input_add(sip->fd, GAIM_INPUT_READ, simple_udp_process, sip->gc);
 
 	sip->resendtimeout = gaim_timeout_add(2500, (GSourceFunc) resend_timeout, sip);
+	sip->registertimeout = gaim_timeout_add((rand()%100)+10*1000, (GSourceFunc)subscribe_timeout, sip);
 	do_register(sip);
 }
 
@@ -1334,10 +1336,6 @@
 		gaim_srv_resolve("sip","udp",hosttoconnect,srvresolved, sip);
 	}
 	g_free(hosttoconnect);
-
-	/* register timeout callback for register / subscribe renewal */
-	/* TODO: What if the timeout is called before gaim_srv_resolve() finishes?! */
-	sip->registertimeout = gaim_timeout_add((rand()%100)+10*1000, (GSourceFunc)register_timeout, sip);
 }
 
 static void simple_close(GaimConnection *gc)