changeset 10116:9f358a718f38

[gaim-migrate @ 11153] I went through every commit email on oldstatus since we branched, and merged relevant things to HEAD that had only been applied on oldstatus. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 18 Oct 2004 19:02:33 +0000
parents 4fd312ceaa29
children d520ab74fe8f
files src/conversation.c src/gtkaccount.c src/gtkconv.c src/gtkdialogs.c src/gtkrequest.c src/protocols/jabber/presence.c src/protocols/msn/dialog.c src/protocols/msn/msn.c src/protocols/msn/object.c src/protocols/novell/novell.c src/protocols/oscar/locate.c src/protocols/oscar/oscar.c src/protocols/oscar/util.c src/protocols/silc/pk.c src/protocols/zephyr/zephyr.c src/server.c
diffstat 16 files changed, 98 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/conversation.c	Mon Oct 18 19:02:33 2004 +0000
@@ -922,18 +922,23 @@
 	if (conv->name  != NULL) g_free(conv->name);
 	if (conv->title != NULL) g_free(conv->title);
 
+	conv->name = NULL;
+	conv->title = NULL;
+
 	for (node = g_list_first(conv->send_history);
 		 node != NULL;
 		 node = g_list_next(node)) {
 
 		if (node->data != NULL)
 			g_free(node->data);
+		node->data = NULL;
 	}
 
 	g_list_free(g_list_first(conv->send_history));
 
 	if (conv->history != NULL)
 		g_string_free(conv->history, TRUE);
+	conv->history = NULL;
 
 	conversations = g_list_remove(conversations, conv);
 
@@ -943,8 +948,10 @@
 
 		if (conv->u.im->icon != NULL)
 			gaim_buddy_icon_unref(conv->u.im->icon);
+		conv->u.im->icon = NULL;
 
 		g_free(conv->u.im);
+		conv->u.im = NULL;
 
 		ims = g_list_remove(ims, conv);
 	}
@@ -953,28 +960,37 @@
 		for (node = conv->u.chat->in_room; node != NULL; node = node->next) {
 			if (node->data != NULL)
 				g_free(node->data);
+			node->data = NULL;
 		}
 
 		for (node = conv->u.chat->ignored; node != NULL; node = node->next) {
 			if (node->data != NULL)
 				g_free(node->data);
+			node->data = NULL;
 		}
 
 		g_list_free(conv->u.chat->in_room);
 		g_list_free(conv->u.chat->ignored);
 
+		conv->u.chat->in_room = NULL;
+		conv->u.chat->ignored = NULL;
+
 		if (conv->u.chat->who != NULL)
 			g_free(conv->u.chat->who);
+		conv->u.chat->who = NULL;
 
 		if (conv->u.chat->topic != NULL)
 			g_free(conv->u.chat->topic);
+		conv->u.chat->topic = NULL;
 
 		g_free(conv->u.chat);
+		conv->u.chat = NULL;
 
 		chats = g_list_remove(chats, conv);
 	}
 
 	g_hash_table_destroy(conv->data);
+	conv->data = NULL;
 
 	if (win != NULL) {
 		gaim_conv_window_remove_conversation(win,
@@ -986,6 +1002,7 @@
 
 	gaim_log_free(conv->log);
 	g_free(conv);
+	conv = NULL;
 }
 
 GaimConversationType
@@ -1107,7 +1124,7 @@
 		}
 	}
 
-	if(!text)
+	if(text == NULL)
 		text = name;
 
 	gaim_conversation_set_title(conv, text);
--- a/src/gtkaccount.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/gtkaccount.c	Mon Oct 18 19:02:33 2004 +0000
@@ -2009,7 +2009,7 @@
 							  gaim_account_get_username(account));
 
 		gaim_request_close_with_handle(account);
-		gaim_request_action(account, NULL, buf, NULL, 1, account, 2,
+		gaim_request_action(account, NULL, buf, NULL, 0, account, 2,
 							_("Delete"), delete_account_cb,
 							_("Cancel"), NULL);
 		g_free(buf);
@@ -2505,7 +2505,7 @@
 	else
 	{
 		gaim_request_action(NULL, NULL, _("Add buddy to your list?"),
-							buffer, 0, data, 2,
+							buffer, GAIM_DEFAULT_ACTION_NONE, data, 2,
 							_("Add"),    G_CALLBACK(add_user_cb),
 							_("Cancel"), G_CALLBACK(free_add_user_data));
 	}
--- a/src/gtkconv.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/gtkconv.c	Mon Oct 18 19:02:33 2004 +0000
@@ -2311,10 +2311,18 @@
 static GdkPixbuf *
 get_tab_icon(GaimConversation *conv, gboolean small_icon)
 {
-	GaimAccount *account = gaim_conversation_get_account(conv);
-	const char *name = gaim_conversation_get_name(conv);
+	GaimAccount *account = NULL;
+	const char *name = NULL;
 	GdkPixbuf *status = NULL;
 
+	g_return_val_if_fail(conv != NULL, NULL);
+
+	account = gaim_conversation_get_account(conv);
+	name = gaim_conversation_get_name(conv);
+
+	g_return_val_if_fail(account != NULL, NULL);
+	g_return_val_if_fail(name != NULL, NULL);
+
 	if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
 		GaimBuddy *b = gaim_find_buddy(account, name);
 		if (b != NULL) {
@@ -2348,12 +2356,16 @@
 	const char *name;
 	GdkPixbuf *status = NULL;
 
+	g_return_if_fail(conv != NULL);
+
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 	name = gaim_conversation_get_name(conv);
 	account = gaim_conversation_get_account(conv);
 
 	status = get_tab_icon(conv, TRUE);
 
+	g_return_if_fail(status != NULL);
+
 	gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->icon), status);
 	gtk_image_set_from_pixbuf(GTK_IMAGE(gtkconv->menu_icon), status);
 
@@ -5531,6 +5543,8 @@
 	GaimGtkChatPane *gtkchat;
 	GaimConvChat *chat;
 
+	g_return_if_fail(conv != NULL);
+
 	win     = gaim_conversation_get_window(conv);
 	gtkwin  = GAIM_GTK_WINDOW(win);
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
@@ -5744,6 +5758,8 @@
 	if (gtkconv->u.im->iter != NULL)
 		g_object_unref(G_OBJECT(gtkconv->u.im->iter));
 
+	gtkconv->u.im->iter = NULL;
+
 	if (!gaim_prefs_get_bool("/gaim/gtk/conversations/im/show_buddy_icons"))
 		return;
 
--- a/src/gtkdialogs.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/gtkdialogs.c	Mon Oct 18 19:02:33 2004 +0000
@@ -69,6 +69,7 @@
 	{"Ethan 'Paco-Paco' Blanton",	N_("developer"), NULL},
 	{"Tim 'marv' Ringenbach",		N_("developer"), NULL},
 	{"Luke 'LSchiere' Schierer",	N_("support"), NULL},
+	{"Stu 'nosnilmot' Tomlinson",	N_("developer"), NULL},
 	{NULL, NULL, NULL}
 };
 
@@ -230,7 +231,7 @@
 						   _("Active Developers"));
 	for (i = 0; developers[i].name != NULL; i++) {
 		if (developers[i].email != NULL) {
-			g_string_append_printf(str, "  %s (%s) &lt;<a href=\"mailto: %s\">%s</a>&gt;<br/>",
+			g_string_append_printf(str, "  %s (%s) &lt;<a href=\"mailto:%s\">%s</a>&gt;<br/>",
 					developers[i].name, _(developers[i].role),
 					developers[i].email, developers[i].email);
 		} else {
@@ -253,7 +254,6 @@
 					"  Benjamin Miller<BR>"
 					"  Etan 'deryni' Reisner<BR>"
 					"  Kevin 'SimGuy' Stange<BR>"
-					"  Stu 'nosnilmot' Tomlinson<BR>"
 					"<BR>");
 
 	/* Retired Developers */
@@ -261,7 +261,7 @@
 						   _("Retired Developers"));
 	for (i = 0; retired_developers[i].name != NULL; i++) {
 		if (retired_developers[i].email != NULL) {
-			g_string_append_printf(str, "  %s (%s) &lt;<A HREF=\"mailto: %s\">%s</a>&gt;<br/>",
+			g_string_append_printf(str, "  %s (%s) &lt;<a href=\"mailto:%s\">%s</a>&gt;<br/>",
 					retired_developers[i].name, _(retired_developers[i].role),
 					retired_developers[i].email, retired_developers[i].email);
 		} else {
@@ -276,7 +276,7 @@
 						   _("Current Translators"));
 	for (i = 0; current_translators[i].language != NULL; i++) {
 		if (current_translators[i].email != NULL) {
-			g_string_append_printf(str, "  <b>%s (%s)</b> - %s &lt;<a href=\"mailto: %s\">%s</a>&gt;<br/>",
+			g_string_append_printf(str, "  <b>%s (%s)</b> - %s &lt;<a href=\"mailto:%s\">%s</a>&gt;<br/>",
 							_(current_translators[i].language),
 							current_translators[i].abbr,
 							_(current_translators[i].name),
@@ -296,7 +296,7 @@
 						   _("Past Translators"));
 	for (i = 0; past_translators[i].language != NULL; i++) {
 		if (past_translators[i].email != NULL) {
-			g_string_append_printf(str, "  <b>%s (%s)</b> - %s &lt;<a href=\"mailto: %s\">%s</a>&gt;<br/>",
+			g_string_append_printf(str, "  <b>%s (%s)</b> - %s &lt;<a href=\"mailto:%s\">%s</a>&gt;<br/>",
 							_(past_translators[i].language),
 							past_translators[i].abbr,
 							_(past_translators[i].name),
--- a/src/gtkrequest.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/gtkrequest.c	Mon Oct 18 19:02:33 2004 +0000
@@ -1396,7 +1396,7 @@
 	if ((data->u.file.savedialog == TRUE) &&
 		(g_file_test(data->u.file.name, G_FILE_TEST_EXISTS))) {
 		gaim_request_yes_no(data, NULL, _("That file already exists"),
-							_("Would you like to overwrite it?"), 1, data,
+							_("Would you like to overwrite it?"), 0, data,
 							G_CALLBACK(file_yes_no_cb),
 							G_CALLBACK(file_yes_no_cb));
 	} else
--- a/src/protocols/jabber/presence.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/jabber/presence.c	Mon Oct 18 19:02:33 2004 +0000
@@ -209,7 +209,8 @@
 		jap->gc = js->gc;
 		jap->who = g_strdup(from);
 
-		gaim_request_action(js->gc, NULL, msg, NULL, 0, jap, 2,
+		gaim_request_action(js->gc, NULL, msg, NULL, GAIM_DEFAULT_ACTION_NONE, 
+				jap, 2,
 				_("Authorize"), G_CALLBACK(authorize_add_cb),
 				_("Deny"), G_CALLBACK(deny_add_cb));
 		g_free(msg);
--- a/src/protocols/msn/dialog.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/msn/dialog.c	Mon Oct 18 19:02:33 2004 +0000
@@ -108,7 +108,8 @@
 								 passport);
 	}
 
-	gaim_request_action(gc, NULL, msg, reason, 0, data, 2,
+	gaim_request_action(gc, NULL, msg, reason, GAIM_DEFAULT_ACTION_NONE, 
+						data, 2,
 						_("Yes"), G_CALLBACK(msn_add_cb),
 						_("No"), G_CALLBACK(msn_rem_cb));
 
--- a/src/protocols/msn/msn.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/msn/msn.c	Mon Oct 18 19:02:33 2004 +0000
@@ -405,6 +405,24 @@
 		gaim_xfer_request(xfer);
 }
 
+static gboolean
+msn_can_receive_file(GaimConnection *gc, const char *who)
+{
+	GaimAccount *account;
+	char *normal;
+	gboolean ret;
+
+	account = gaim_connection_get_account(gc);
+
+	normal = g_strdup(msn_normalize(account, gaim_account_get_username(account)));
+
+	ret = strcmp(normal, msn_normalize(account, who));
+
+	g_free(normal);
+
+	return ret;
+}
+
 /**************************************************************************
  * Protocol Plugin ops
  **************************************************************************/
@@ -1860,7 +1878,7 @@
 	NULL,					/* roomlist_get_list */
 	NULL,					/* roomlist_cancel */
 	NULL,					/* roomlist_expand_category */
-	NULL,					/* can_receive_file */
+	msn_can_receive_file,	/* can_receive_file */
 	msn_send_file			/* send_file */
 };
 
--- a/src/protocols/msn/object.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/msn/object.c	Mon Oct 18 19:02:33 2004 +0000
@@ -28,9 +28,12 @@
 	{ \
 		tag += strlen(id "=\""); \
 		c = strchr(tag, '"'); \
-		if (obj->field != NULL) \
-			g_free(obj->field); \
-		obj->field = g_strndup(tag, c - tag); \
+		if (c != NULL) \
+		{ \
+			if (obj->field != NULL) \
+				g_free(obj->field); \
+			obj->field = g_strndup(tag, c - tag); \
+		} \
 	}
 
 #define GET_INT_TAG(field, id) \
--- a/src/protocols/novell/novell.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/novell/novell.c	Mon Oct 18 19:02:33 2004 +0000
@@ -1894,7 +1894,8 @@
 	parms = g_slist_append(parms, nm_event_get_conference(event));
 
 	/* Prompt the user */
-	gaim_request_action(NULL, title, primary, secondary, -1, parms, 2,
+	gaim_request_action(NULL, title, primary, secondary, 
+						GAIM_DEFAULT_ACTION_NONE, parms, 2,
 						_("Yes"), G_CALLBACK(_join_conference_cb),
 						_("No"), G_CALLBACK(_reject_conference_cb));
 
--- a/src/protocols/oscar/locate.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/oscar/locate.c	Mon Oct 18 19:02:33 2004 +0000
@@ -351,7 +351,12 @@
 }
 
 faim_export aim_userinfo_t *aim_locate_finduserinfo(aim_session_t *sess, const char *sn) {
-	aim_userinfo_t *cur = sess->locate.userinfo;
+	aim_userinfo_t *cur = NULL;
+
+	if (sn == NULL)
+		return NULL;
+
+	cur = sess->locate.userinfo;
 
 	while (cur != NULL) {
 		if (aim_sncmp(cur->sn, sn) == 0)
--- a/src/protocols/oscar/oscar.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Oct 18 19:02:33 2004 +0000
@@ -4173,13 +4173,15 @@
 	g_string_append_printf(str, "<b>%s:</b> %s", _("Screen Name"), userinfo->sn);
 	g_string_append_printf(str, "\n<br><b>%s</b>: %d%%", _("Warning Level"), (int)((userinfo->warnlevel/10.0) + 0.5));
 
-	if (userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE)
-		oscar_string_append(str, "\n<br>", _("Online Since"),
-							asctime(localtime((time_t *)&userinfo->onlinesince)));
-
-	if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE)
-		oscar_string_append(str, "\n<br>", _("Member Since"),
-							asctime(localtime((time_t *)&userinfo->membersince)));
+	if (userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE) {
+		time_t t = userinfo->onlinesince;
+		oscar_string_append(str, "\n<br>", _("Online Since"), ctime(&t));
+	}
+
+	if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) {
+		time_t t = userinfo->membersince;
+		oscar_string_append(str, "\n<br>", _("Member Since"), ctime(&t));
+	}
 
 	if (userinfo->present & AIM_USERINFO_PRESENT_IDLE) {
 		tmp = gaim_str_seconds_to_string(userinfo->idletime*60);
@@ -6252,7 +6254,7 @@
 	data->nick = NULL;
 
 	gaim_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg,
-						0, data,
+						GAIM_DEFAULT_ACTION_NONE, data,
 						G_CALLBACK(gaim_icq_buddyadd),
 						G_CALLBACK(oscar_free_name_data));
 
@@ -6657,7 +6659,7 @@
 			ret = g_strdup(_("Away"));
 	} else if (GAIM_BUDDY_IS_ONLINE(b)) {
 		struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name));
-		if (bi->availmsg)
+		if ((bi != NULL) && (bi->availmsg != NULL))
 			ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg));
 	} else {
 		char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name);
--- a/src/protocols/oscar/util.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/oscar/util.c	Mon Oct 18 19:02:33 2004 +0000
@@ -274,6 +274,9 @@
 faim_export int aim_sncmp(const char *sn1, const char *sn2)
 {
 
+	if ((sn1 == NULL) || (sn2 == NULL))
+		return -1;
+
 	do {
 		while (*sn2 == ' ')
 			sn2++;
--- a/src/protocols/silc/pk.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/silc/pk.c	Mon Oct 18 19:02:33 2004 +0000
@@ -112,7 +112,8 @@
 		   _("Fingerprint and babbleprint for the %s key are:\n\n"
 		     "%s\n%s\n"), entity, fingerprint, babbleprint);
 
-	gaim_request_action(NULL, _("Verify Public Key"), tmp, tmp2, 2, verify, 3,
+	gaim_request_action(NULL, _("Verify Public Key"), tmp, tmp2, 
+						GAIM_DEFAULT_ACTION_NONE, verify, 3,
 			    _("Yes"), G_CALLBACK(silcgaim_verify_cb),
 			    _("No"), G_CALLBACK(silcgaim_verify_cb),
 			    _("View..."), G_CALLBACK(silcgaim_verify_details));
--- a/src/protocols/zephyr/zephyr.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/protocols/zephyr/zephyr.c	Mon Oct 18 19:02:33 2004 +0000
@@ -102,7 +102,7 @@
 
 parse_tree null_parse_tree = { 
 	"", 
-	{}, 
+	{NULL}, 
 	0,
 };
 
--- a/src/server.c	Mon Oct 18 17:25:25 2004 +0000
+++ b/src/server.c	Mon Oct 18 19:02:33 2004 +0000
@@ -102,7 +102,6 @@
 
 void serv_close(GaimConnection *gc)
 {
-	GaimPlugin *prpl;
 	GaimPluginProtocolInfo *prpl_info = NULL;
 
 	while (gc->buddy_chats) {
@@ -124,8 +123,6 @@
 		if (prpl_info->close)
 			(prpl_info->close)(gc);
 	}
-
-	prpl = gc->prpl;
 }
 
 void serv_touch_idle(GaimConnection *gc)