changeset 10009:c124bef68132

[gaim-migrate @ 10926] Thou shalt NULL terminate va_lists! This fixes the crash-at-startup bug I mentioned in my commit of Dave West's stuff last night. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 10 Sep 2004 19:51:52 +0000
parents 50c1724d5e59
children 56e34a659db2
files src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/oscar/oscar.c src/protocols/rendezvous/rendezvous.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/status.c
diffstat 8 files changed, 26 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/gg/gg.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/gg/gg.c	Fri Sep 10 19:51:52 2004 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 10849 2004-09-05 06:29:51Z faceprint $
+ * $Id: gg.c 10926 2004-09-10 19:51:52Z thekingant $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  *
@@ -274,43 +274,43 @@
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_AVAILABLE, "available", AGG_STATUS_AVAIL,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_AWAY, "away", AGG_STATUS_BUSY,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_HIDDEN, "invisible", AGG_STATUS_INVISIBLE,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_AVAILABLE, "available-friends", AGG_STATUS_AVAIL_FRIENDS,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_AWAY, "away-friends", AGG_STATUS_BUSY_FRIENDS,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_HIDDEN, "invisible-friends", AGG_STATUS_INVISIBLE,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_UNAVAILABLE, "unavailable", AGG_STATUS_NOT_AVAIL,
 		TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	return types;
--- a/src/protocols/irc/irc.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/irc/irc.c	Fri Sep 10 19:51:52 2004 +0000
@@ -164,8 +164,7 @@
 
 	type = gaim_status_type_new_with_attrs(
 		GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE,
-		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
-
+		"message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	return types;
--- a/src/protocols/jabber/jabber.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/jabber/jabber.c	Fri Sep 10 19:51:52 2004 +0000
@@ -991,7 +991,7 @@
 	/*
 	if(js->protocol_version == JABBER_PROTO_0_9)
 		m = g_list_append(m, _("Invisible"));
-		*/
+	*/
 
 	return types;
 }
--- a/src/protocols/oscar/oscar.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Fri Sep 10 19:51:52 2004 +0000
@@ -2978,6 +2978,8 @@
 
 	if (time_idle > 0)
 		gaim_prpl_got_user_idle(account, info->sn, TRUE, time_idle);
+	else
+		gaim_prpl_got_user_idle(account, info->sn, FALSE, 0);
 
 	return 1;
 }
--- a/src/protocols/rendezvous/rendezvous.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/rendezvous/rendezvous.c	Fri Sep 10 19:51:52 2004 +0000
@@ -93,7 +93,7 @@
 	b = gaim_buddy_new(account, name, NULL);
 	/* gaim_blist_node_set_flag(b, GAIM_BLIST_NODE_FLAG_NO_SAVE); */
 	gaim_blist_add_buddy(b, NULL, g, NULL);
-	serv_got_update(gc, b->name, TRUE, 0);
+	gaim_prpl_got_user_status(account, b->name, "online", NULL);
 
 #if 0
 	RendezvousBuddy *rb;
@@ -123,7 +123,7 @@
 	if (b == NULL)
 		return;
 
-	serv_got_update(gc, b->name, FALSE, 0);
+	gaim_prpl_got_user_status(account, b->name, "offline", NULL);
 	gaim_blist_remove_buddy(b);
 	/* XXX - This results in incorrect group counts--needs to be fixed in the core */
 	/* XXX - We also need to call remove_idle_buddy() in server.c for idle buddies */ 
@@ -155,7 +155,7 @@
 					b = (GaimBuddy *)bnode;
 					if (b->account != account)
 						continue;
-					serv_got_update(gc, b->name, FALSE, 0);
+					gaim_prpl_got_user_status(account, b->name, "offline", NULL);
 					gaim_blist_remove_buddy(b);
 				}
 			}
@@ -241,11 +241,12 @@
 				rb->idle += 978307200; /* convert to seconds-since-epoch */
 			}
 			rb->status = UC_IDLE;
+			gaim_prpl_got_user_idle(account, b->name, TRUE, rb->idle);
 		} else if (!strcmp(node1->value, "dnd")) {
 			/* Away */
 			rb->status = UC_UNAVAILABLE;
 		}
-		serv_got_update(gc, name, TRUE, 0);
+		gaim_prpl_got_user_status(account, b->name, "online", NULL);
 		/* XXX - Idle time is rb->idle and status is rb->status */
 	}
 
--- a/src/protocols/yahoo/yahoo.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Fri Sep 10 19:51:52 2004 +0000
@@ -3101,7 +3101,7 @@
 		type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available-wm",
 		                                       "Available With Message", TRUE, TRUE, FALSE,
 		                                       "message", _("Message"),
-		                                       gaim_value_new(GAIM_TYPE_STRING));
+		                                       gaim_value_new(GAIM_TYPE_STRING), NULL);
 		types = g_list_append(types, type);
 
 
@@ -3135,7 +3135,7 @@
 		type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, "away",
 		                                       "Away", TRUE, TRUE, FALSE,
 		                                       "message", _("Message"),
-		                                       gaim_value_new(GAIM_TYPE_STRING));
+		                                       gaim_value_new(GAIM_TYPE_STRING), NULL);
 		types = g_list_append(types, type);
 	}
 	type = gaim_status_type_new(GAIM_STATUS_HIDDEN, "invisible", _("Invisible"), TRUE);
--- a/src/protocols/zephyr/zephyr.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/protocols/zephyr/zephyr.c	Fri Sep 10 19:51:52 2004 +0000
@@ -2173,7 +2173,7 @@
 
 	type = gaim_status_type_new_with_attrs(
 					       GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE,
-					       "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING));
+					       "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
 	return types;
--- a/src/status.c	Fri Sep 10 04:43:31 2004 +0000
+++ b/src/status.c	Fri Sep 10 19:51:52 2004 +0000
@@ -171,8 +171,8 @@
  **************************************************************************/
 GaimStatusType *
 gaim_status_type_new_full(GaimStatusPrimitive primitive, const char *id,
-		const char *name, gboolean saveable,
-		gboolean user_settable, gboolean independent)
+						  const char *name, gboolean saveable,
+						  gboolean user_settable, gboolean independent)
 {
 	GaimStatusType *status_type;
 
@@ -194,7 +194,7 @@
 
 GaimStatusType *
 gaim_status_type_new(GaimStatusPrimitive primitive, const char *id,
-		const char *name, gboolean user_settable)
+					 const char *name, gboolean user_settable)
 {
 	g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL);
 	g_return_val_if_fail(id        != NULL,              NULL);
@@ -905,8 +905,8 @@
 	presence->context = context;
 
 	presence->status_table =
-	g_hash_table_new_full(g_str_hash, g_str_equal,
-	g_free, (GFreeFunc)gaim_status_destroy);
+		g_hash_table_new_full(g_str_hash, g_str_equal,
+							  g_free, (GFreeFunc)gaim_status_destroy);
 
 	return presence;
 }
@@ -915,6 +915,7 @@
 gaim_presence_new_for_account(GaimAccount *account)
 {
 	GaimPresence *presence;
+
 	g_return_val_if_fail(account != NULL, NULL);
 
 	presence = gaim_presence_new(GAIM_PRESENCE_CONTEXT_ACCOUNT);