changeset 27180:7492ddb953fd

On MSN, increase the history size for the NS so that people with lots of buddies on an unknown network (thus requiring many FQY/ADL requests) will not lose the original request (causing a crash). Fixes #8579.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 26 Jun 2009 01:28:09 +0000
parents 6e4afab5576d
children 6e4b0ecde9b4
files libpurple/protocols/msn/cmdproc.c libpurple/protocols/msn/history.c libpurple/protocols/msn/history.h
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/cmdproc.c	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/cmdproc.c	Fri Jun 26 01:28:09 2009 +0000
@@ -210,6 +210,7 @@
 
 	trans = g_new0(MsnTransaction, 1);
 
+	trans->cmdproc = cmdproc;
 	trans->command = g_strdup(command);
 
 	if (format != NULL)
--- a/libpurple/protocols/msn/history.c	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/history.c	Fri Jun 26 01:28:09 2009 +0000
@@ -68,6 +68,7 @@
 msn_history_add(MsnHistory *history, MsnTransaction *trans)
 {
 	GQueue *queue;
+	int max_elems;
 
 	g_return_if_fail(history != NULL);
 	g_return_if_fail(trans   != NULL);
@@ -78,7 +79,12 @@
 
 	g_queue_push_tail(queue, trans);
 
-	if (queue->length > MSN_HIST_ELEMS)
+	if (trans->cmdproc->servconn->type == MSN_SERVCONN_NS)
+		max_elems = MSN_NS_HIST_ELEMS;
+	else
+		max_elems = MSN_SB_HIST_ELEMS;
+
+	if (queue->length > max_elems)
 	{
 		trans = g_queue_pop_head(queue);
 		msn_transaction_destroy(trans);
--- a/libpurple/protocols/msn/history.h	Thu Jun 25 21:19:10 2009 +0000
+++ b/libpurple/protocols/msn/history.h	Fri Jun 26 01:28:09 2009 +0000
@@ -24,7 +24,8 @@
 #ifndef _MSN_HISTORY_H
 #define _MSN_HISTORY_H
 
-#define MSN_HIST_ELEMS 0x30
+#define MSN_NS_HIST_ELEMS 0x300
+#define MSN_SB_HIST_ELEMS 0x30
 
 typedef struct _MsnHistory MsnHistory;