changeset 27264:7f5ce6fa0a25

Provide a custom URL per-email for gmail notifications, since Google gives it to us. This doesn't actually work for me (even though the URL is correct), but I assume that has something to do with some crazy adblock/noscript/popup blocker extensions.
author Paul Aurich <paul@darkrain42.org>
date Fri, 03 Jul 2009 05:25:41 +0000
parents 975a29213f35
children 5afc3577b8cd e01ef82ba0f2
files libpurple/protocols/jabber/google.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Fri Jul 03 05:03:20 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Fri Jul 03 05:25:41 2009 +0000
@@ -787,7 +787,7 @@
 {
 	xmlnode *child;
 	xmlnode *message;
-	const char *to, *url;
+	const char *to, *default_url;
 	const char *in_str;
 	char *to_name;
 
@@ -837,16 +837,20 @@
 
 	to = xmlnode_get_attrib(packet, "to");
 	to_name = jabber_get_bare_jid(to);
-	url = xmlnode_get_attrib(child, "url");
-	if (!url || !*url)
-		url = "http://www.gmail.com";
+	default_url = xmlnode_get_attrib(child, "url");
+	if (default_url == NULL || *default_url == '\0')
+		default_url = "https://mail.google.com/mail";
 
 	message= xmlnode_get_child(child, "mail-thread-info");
 	for (i=0; message; message = xmlnode_get_next_twin(message), i++) {
 		xmlnode *sender_node, *subject_node;
-		const char *from, *tid;
+		const char *from, *tid, *url;
 		char *subject;
 
+		url = xmlnode_get_attrib(message, "url");
+		if (url == NULL || *url == '\0')
+			url = default_url;
+
 		subject_node = xmlnode_get_child(message, "subject");
 		sender_node  = xmlnode_get_child(message, "senders");
 		sender_node  = xmlnode_get_child(sender_node, "sender");