changeset 22501:cf596f8b7c48

merge of '3195166356877e091e9b3d663bc03f7682ed3a17' and 'f098694fd1cdc20d007bd8673331025582164fed'
author Etan Reisner <pidgin@unreliablesource.net>
date Wed, 27 Feb 2008 00:24:57 +0000
parents 981169c12d12 (diff) 89a036334991 (current diff)
children 1eadbca855f0
files libpurple/account.c
diffstat 9 files changed, 68 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 26 01:33:35 2008 +0000
+++ b/ChangeLog	Wed Feb 27 00:24:57 2008 +0000
@@ -1,6 +1,6 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
-version 2.4.0 (??/??/????):
+version 2.4.0 (??/??/2008):
 	libpurple:
 	* Fixed various problems with loss of status messages when going
 	  or returning from idle on MySpaceIM.
@@ -16,9 +16,14 @@
 	* The AIM/ICQ server-side preference for "allow others to see me
 	  as idle" is no longer unconditionally set to "yes" even when
 	  your libpurple preference is "no."
+	* Fix SSL certificate checks for renewed certificates
+	* Fix the ability to set vCard buddy icons on Google Talk/XMPP
+	* D-Bus fixes on 64bit
 	* Fixed retrieval of buddy icons and setting of server-side aliases on
 	  Yahoo! and Yahoo! Japan when using an HTTP proxy server (Gideon N.
 	  Guillen)
+	* Fixed an MSN bug that would leave you appearing offline when transferred
+	  to different server
 
 	Pidgin:
 	* Added the ability to theme conversation name colors (red and blue)
@@ -28,6 +33,7 @@
 	  de Andrade)
 	* Save the conversation "Enable Logging" option per-contact (Moos
 	  Heintzen)
+	* Typing notifications are now shown in the conversation area
 
 	Finch:
 	* Color is used in the buddylist to indicate status, and the conversation
@@ -47,6 +53,7 @@
 	* Added a log viewer
 	* Added the ability to block/unblock buddies - see the buddy context menu
 	  and the menu for the buddy list.
+	* Fixed a bug preventing finch working on x86_64
 
 version 2.3.1 (12/7/2007):
 	http://developer.pidgin.im/query?status=closed&milestone=2.3.1
--- a/ChangeLog.API	Tue Feb 26 01:33:35 2008 +0000
+++ b/ChangeLog.API	Wed Feb 27 00:24:57 2008 +0000
@@ -9,6 +9,7 @@
 		  purple_micro_version variables are exported by version.h,
 		  giving the version of libpurple in use at runtime.
 		* purple_util_set_current_song, purple_util_format_song_info
+		* purple_ip_address_is_valid
 		* Some accessor functions to the Roomlist API:
 			* purple_roomlist_get_fields
 			* purple_roomlist_room_get_type
--- a/libpurple/account.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/account.c	Wed Feb 27 00:24:57 2008 +0000
@@ -2369,8 +2369,13 @@
 static void
 set_current_error(PurpleAccount *account, PurpleConnectionErrorInfo *new_err)
 {
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-	PurpleConnectionErrorInfo *old_err = priv->current_error;
+	PurpleAccountPrivate *priv;
+	PurpleConnectionErrorInfo *old_err;
+
+	g_return_if_fail(account != NULL);
+
+	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+	old_err = priv->current_error;
 
 	if(new_err == old_err)
 		return;
@@ -2395,9 +2400,14 @@
                     const gchar *description,
                     gpointer unused)
 {
-	PurpleAccount *account = purple_connection_get_account(gc);
-	PurpleConnectionErrorInfo *err = g_new0(PurpleConnectionErrorInfo, 1);
-	PURPLE_DBUS_REGISTER_POINTER(err, PurpleConnectionErrorInfo);
+	PurpleAccount *account;
+	PurpleConnectionErrorInfo *err;
+
+	account = purple_connection_get_account(gc);
+
+	g_return_if_fail(account != NULL);
+
+	err = g_new0(PurpleConnectionErrorInfo, 1);
 
 	err->type = type;
 	err->description = g_strdup(description);
--- a/libpurple/protocols/irc/msgs.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/protocols/irc/msgs.c	Wed Feb 27 00:24:57 2008 +0000
@@ -495,6 +495,8 @@
 					cur++;
 				} else if(irc->mode_chars
 					  && strchr(irc->mode_chars, *cur)) {
+					if (*cur == '~')
+						f = PURPLE_CBFLAGS_FOUNDER;
 					cur++;
 				}
 				tmp = g_strndup(cur, end - cur);
@@ -854,6 +856,9 @@
 					newflag = PURPLE_CBFLAGS_HALFOP;
 				else if (*mcur == 'v')
 					newflag = PURPLE_CBFLAGS_VOICE;
+				else if(irc->mode_chars
+					  && strchr(irc->mode_chars, '~') && (*mcur == 'q'))
+					newflag = PURPLE_CBFLAGS_FOUNDER;
 				if (newflag) {
 					if (add)
 						flags |= newflag;
--- a/libpurple/protocols/jabber/jabber.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Wed Feb 27 00:24:57 2008 +0000
@@ -564,9 +564,16 @@
 			jabber_login_callback_ssl, jabber_ssl_connect_failure, js->certificate_CN, js->gc);
 }
 
-static void jabber_login_connect(JabberStream *js, const char *fqdn, const char *host, int port)
+static void jabber_login_connect(JabberStream *js, const char *domain, const char *host, int port)
 {
-	js->serverFQDN = g_strdup(fqdn);
+	/* host should be used in preference to domain to
+	 * allow SASL authentication to work with FQDN of the server,
+	 * but we use domain as fallback for when users enter IP address
+	 * in connect server */
+	if (purple_ip_address_is_valid(host))
+		js->serverFQDN = g_strdup(domain);
+	else
+		js->serverFQDN = g_strdup(host);
 
 	if (purple_proxy_connect(js->gc, js->gc->account, host,
 			port, jabber_login_callback, js->gc) == NULL)
--- a/libpurple/protocols/silc/util.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/protocols/silc/util.c	Wed Feb 27 00:24:57 2008 +0000
@@ -442,6 +442,7 @@
 		strcat(buf, "[rejects watching] ");
 	if (mode & SILC_UMODE_BLOCK_INVITE)
 		strcat(buf, "[blocks invites] ");
+	g_strchomp(buf);
 }
 
 void silcpurple_get_chmode_string(SilcUInt32 mode, char *buf,
@@ -470,6 +471,7 @@
 		strcat(buf, "[users silenced] ");
 	if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
 		strcat(buf, "[operators silenced] ");
+	g_strchomp(buf);
 }
 
 void silcpurple_get_chumode_string(SilcUInt32 mode, char *buf,
@@ -488,6 +490,7 @@
 		strcat(buf, "[blocks robot messages] ");
 	if (mode & SILC_CHANNEL_UMODE_QUIET)
 		strcat(buf, "[quieted] ");
+	g_strchomp(buf);
 }
 
 void
@@ -544,6 +547,7 @@
 	if (strlen(s->str)) {
 		*moodstr = s->str;
 		g_string_free(s, FALSE);
+		g_strchomp(*moodstr);
 	} else
 		g_string_free(s, TRUE);
 
@@ -573,6 +577,7 @@
 	if (strlen(s->str)) {
 		*contactstr = s->str;
 		g_string_free(s, FALSE);
+		g_strchomp(*contactstr);
 	} else
 		g_string_free(s, TRUE);
 
--- a/libpurple/protocols/silc10/util.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/protocols/silc10/util.c	Wed Feb 27 00:24:57 2008 +0000
@@ -432,6 +432,7 @@
 		strcat(buf, "[rejects watching] ");
 	if (mode & SILC_UMODE_BLOCK_INVITE)
 		strcat(buf, "[blocks invites] ");
+	g_strchomp(buf);
 }
 
 void silcpurple_get_chmode_string(SilcUInt32 mode, char *buf,
@@ -460,6 +461,7 @@
 		strcat(buf, "[users silenced] ");
 	if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
 		strcat(buf, "[operators silenced] ");
+	g_strchomp(buf);
 }
 
 void silcpurple_get_chumode_string(SilcUInt32 mode, char *buf,
@@ -478,6 +480,7 @@
 		strcat(buf, "[blocks robot messages] ");
 	if (mode & SILC_CHANNEL_UMODE_QUIET)
 		strcat(buf, "[quieted] ");
+	g_strchomp(buf);
 }
 
 void
@@ -534,6 +537,7 @@
 	if (strlen(s->str)) {
 		*moodstr = s->str;
 		g_string_free(s, FALSE);
+		g_strchomp(*moodstr);
 	} else
 		g_string_free(s, TRUE);
 
@@ -563,6 +567,7 @@
 	if (strlen(s->str)) {
 		*contactstr = s->str;
 		g_string_free(s, FALSE);
+		g_strchomp(*contactstr);
 	} else
 		g_string_free(s, TRUE);
 
--- a/libpurple/util.c	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/util.c	Wed Feb 27 00:24:57 2008 +0000
@@ -4129,6 +4129,17 @@
 	return ((c - domain) > 3 ? TRUE : FALSE);
 }
 
+gboolean
+purple_ip_address_is_valid(const char *ip)
+{
+	int c, o1, o2, o3, o4;
+	char end;
+	c = sscanf(ip, "%d.%d.%d.%d%c", &o1, &o2, &o3, &o4, &end);
+	if (c > 4 || o1 < 0 || o1 > 255 || o2 < 0 || o2 > 255 || o3 < 0 || o3 > 255 || o4 < 0 || o4 > 255)
+		return FALSE;
+	return TRUE;
+}
+
 /* Stolen from gnome_uri_list_extract_uris */
 GList *
 purple_uri_list_extract_uris(const gchar *uri_list)
--- a/libpurple/util.h	Tue Feb 26 01:33:35 2008 +0000
+++ b/libpurple/util.h	Wed Feb 27 00:24:57 2008 +0000
@@ -1081,6 +1081,15 @@
 gboolean purple_email_is_valid(const char *address);
 
 /**
+ * Checks if the given IP address is a syntactically valid IPv4 address.
+ *
+ * @param address The IP address to validate.
+ *
+ * @return True if the IP address is syntactically correct.
+ */
+gboolean purple_ip_address_is_valid(const char *ip);
+
+/**
  * This function extracts a list of URIs from the a "text/uri-list"
  * string.  It was "borrowed" from gnome_uri_list_extract_uris
  *