changeset 18019:1e674c0886b1

propagate from branch 'im.pidgin.pidgin' (head b917cc2cf9c46c7163ad3345b312dac1eea896cf) to branch 'im.pidgin.rlaager.merging.for_2_1_0' (head 6d4701b6ce24327540b11d93b4e203334a042c6e)
author Richard Laager <rlaager@wiktel.com>
date Sun, 20 May 2007 18:40:58 +0000
parents 2c10f77c2378 (current diff) ddf759c28d0b (diff)
children 3c4811489e30
files ChangeLog pidgin/gtkconv.c
diffstat 6 files changed, 85 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun May 20 15:00:39 2007 +0000
+++ b/ChangeLog	Sun May 20 18:40:58 2007 +0000
@@ -45,6 +45,7 @@
 	  conversation tabs (Ma Xuan)
 	* Fix IRC connection bug with dircproxy (xjoe)
 	* Ctrl+[shift]+tab focuses the next most active tab (William Thompson)
+	* Fix Open Hotmail Inbox for MSN to work more reliably
 	* Add a Google Talk item to the protocol list, to help users who think
 	  we don't support Google Talk.  The item acts just like "XMPP".
 	* Remember if the X server supports XScreenSaver, to avoid waking it
@@ -54,6 +55,7 @@
 	  and the XScreenSaver change will reduce Pidgin's effect on power
 	  consumption when running with NO_HZ.  (Arjan van de Ven with Intel
 	  Corporation)
+	* Conversation -> Save As will now use aliases.
 
 	Finch:
 	* Userlist in chat windows, which can be turned on or off using
--- a/libpurple/protocols/msn/msn.c	Sun May 20 15:00:39 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun May 20 18:40:58 2007 +0000
@@ -342,10 +342,8 @@
 
 	if (session->passport_info.file == NULL)
 	{
-		MsnCmdProc *cmdproc = session->notification->cmdproc;
 		purple_notify_error(gc, NULL,
 						  _("This Hotmail account may not be active."), NULL);
-		msn_cmdproc_send(cmdproc, "URL", "%s", "INBOX");
 		return;
 	}
 
@@ -621,7 +619,8 @@
 	account = purple_connection_get_account(gc);
 	user = msn_normalize(account, purple_account_get_username(account));
 
-	if (strstr(user, "@hotmail.") != NULL)
+	if ((strstr(user, "@hotmail.") != NULL) ||
+		(strstr(user, "@msn.com") != NULL))
 	{
 		m = g_list_append(m, NULL);
 		act = purple_plugin_action_new(_("Open Hotmail Inbox"),
--- a/libpurple/protocols/msn/session.c	Sun May 20 15:00:39 2007 +0000
+++ b/libpurple/protocols/msn/session.c	Sun May 20 18:40:58 2007 +0000
@@ -404,4 +404,9 @@
 
 	/* Sync users */
 	msn_session_sync_users(session);
+	/* It seems that some accounts that haven't accessed hotmail for a while
+	 * and @msn.com accounts don't automatically get the initial email
+	 * notification so we always request it on login
+	 */
+	msn_cmdproc_send(session->notification->cmdproc, "URL", "%s", "INBOX");
 }
--- a/libpurple/purple-remote	Sun May 20 15:00:39 2007 +0000
+++ b/libpurple/purple-remote	Sun May 20 18:40:58 2007 +0000
@@ -94,6 +94,8 @@
 def execute(uri):
     match = re.match(urlregexp, uri)
     protocol = match.group(2)
+    if protocol == "xmpp"
+        protocol = "jabber"
     if protocol == "aim" or protocol == "icq":
         protocol = "oscar"
     if protocol is not None:
--- a/libpurple/util.c	Sun May 20 15:00:39 2007 +0000
+++ b/libpurple/util.c	Sun May 20 18:40:58 2007 +0000
@@ -1874,6 +1874,11 @@
 			while (1) {
 				if (badchar(*t) || badentity(t)) {
 
+					if ((!g_ascii_strncasecmp(c, "http://", 7) && (t - c == 7)) ||
+						(!g_ascii_strncasecmp(c, "https://", 8) && (t - c == 8))) {
+						break;
+					}
+
 					if (*(t) == ',' && (*(t + 1) != ' ')) {
 						t++;
 						continue;
@@ -1933,6 +1938,12 @@
 			t = c;
 			while (1) {
 				if (badchar(*t) || badentity(t)) {
+
+					if ((!g_ascii_strncasecmp(c, "ftp://", 6) && (t - c == 6)) ||
+						(!g_ascii_strncasecmp(c, "sftp://", 7) && (t - c == 7))) {
+						break;
+					}
+
 					if (*(t - 1) == '.')
 						t--;
 					if ((*(t - 1) == ')' && (inside_paren > 0))) {
@@ -1984,8 +1995,21 @@
 			t = c;
 			while (1) {
 				if (badchar(*t) || badentity(t)) {
+					char *d;
+					if (t - c == 7) {
+						break;
+					}
 					if (*(t - 1) == '.')
 						t--;
+					if ((d = strstr(c + 7, "?")) != NULL && d < t)
+						url_buf = g_strndup(c + 7, d - c - 7);
+					else
+						url_buf = g_strndup(c + 7, t - c - 7);
+					if (!purple_email_is_valid(url_buf)) {
+						g_free(url_buf);
+						break;
+					}
+					g_free(url_buf);
 					url_buf = g_strndup(c, t - c);
 					tmpurlbuf = purple_unescape_html(url_buf);
 					g_string_append_printf(ret, "<A HREF=\"%s\">%s</A>",
@@ -2000,6 +2024,39 @@
 				t++;
 
 			}
+		} else if ((*c=='x') && (!g_ascii_strncasecmp(c, "xmpp:", 5)) &&
+				   (c == text || badchar(c[-1]) || badentity(c-1))) {
+			t = c;
+			while (1) {
+				if (badchar(*t) || badentity(t)) {
+
+					if (t - c == 5) {
+						break;
+					}
+
+					if (*(t) == ',' && (*(t + 1) != ' ')) {
+						t++;
+						continue;
+					}
+
+					if (*(t - 1) == '.')
+						t--;
+					if ((*(t - 1) == ')' && (inside_paren > 0))) {
+						t--;
+					}
+
+					url_buf = g_strndup(c, t - c);
+					tmpurlbuf = purple_unescape_html(url_buf);
+					g_string_append_printf(ret, "<A HREF=\"%s\">%s</A>",
+							tmpurlbuf, url_buf);
+					g_free(url_buf);
+					g_free(tmpurlbuf);
+					c = t;
+					break;
+				}
+				t++;
+
+			}
 		} else if (c != text && (*c == '@')) {
 			int flag;
 			GString *gurl_buf = NULL;
@@ -4155,7 +4212,7 @@
 		gunichar c = g_utf8_get_char(iter);
 		/* If the character is an ASCII character and is alphanumeric,
 		 * or one of the specified values, no need to escape */
-		if (c < 128 && (isalnum(c) || c == '@' || c == '-' ||
+		if (c < 128 && (g_ascii_isalnum(c) || c == '@' || c == '-' ||
 				c == '_' || c == '.' || c == '#')) {
 			buf[j++] = c;
 		} else {
--- a/pidgin/gtkconv.c	Sun May 20 15:00:39 2007 +0000
+++ b/pidgin/gtkconv.c	Sun May 20 18:40:58 2007 +0000
@@ -1012,12 +1012,24 @@
 {
 	PidginWindow *win = data;
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
+	PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+	const char *name;
 	gchar *buf;
-
-	buf = g_strdup_printf("%s.html", purple_normalize(conv->account, conv->name));
-
+	gchar *c;
+
+	if (buddy != NULL)
+		name = purple_buddy_get_contact_alias(buddy);
+	else
+		name = purple_normalize(conv->account, conv->name);
+
+	buf = g_strdup_printf("%s.html", name);
+	for (c = buf ; *c ; c++)
+	{
+		if (*c == '/' || *c == '\\')
+			*c = ' ';
+	}
 	purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"),
-					  purple_escape_filename(buf),
+					  buf,
 					  TRUE, G_CALLBACK(savelog_writefile_cb), NULL,
 					  NULL, NULL, conv,
 					  conv);