pidgin: ae4e1a6a: Fix Google Mail notifications when they ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Jul 2 18:30:22 EDT 2009


-----------------------------------------------------------------
Revision: ae4e1a6ad5b5058239a63399cfcac51570912378
Ancestor: d6d62482a33ec2323ec2efb4e5e6be42257e66d3
Author: darkrain42 at pidgin.im
Date: 2009-07-02T22:27:13
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ae4e1a6ad5b5058239a63399cfcac51570912378

Modified files:
        ChangeLog libpurple/protocols/jabber/google.c

ChangeLog: 

Fix Google Mail notifications when they inexplicably weren't working. Fixes #3300.

I don't really know why this is a setting, given that the server can
reasonably determine a client's interest based on an initial request at
login (which is what the google:mail:notify doc still says). Moreover,
they explicitly say clients shouldn't set this setting to false.

-------------- next part --------------
============================================================
--- ChangeLog	c8d014d3051b4f0b260f7bab24e95b9a13a53aaa
+++ ChangeLog	18df7f2a0d35be1c896f9f3d55eeaf22a73f98d8
@@ -70,6 +70,8 @@ version 2.6.0 (??/??/2009):
 	  characters.
 	* Show emblem for mobile, handheld, and web clients and bots (if the other
 	  client supports it).
+	* Google Talk mail notifications should now work for people for whom they
+	  inexplicably did not.  (Thanks to yukam for determining the reason)
 
 	Yahoo:
 	* P2P file transfers.  (Sulabh Mahajan)
============================================================
--- libpurple/protocols/jabber/google.c	02aced3c4f07414bd17762acd50cc7c09e419456
+++ libpurple/protocols/jabber/google.c	0afc59888472d527e3c531e061479113da6fc557
@@ -939,10 +939,25 @@ void jabber_gmail_init(JabberStream *js)
 
 void jabber_gmail_init(JabberStream *js) {
 	JabberIq *iq;
+	xmlnode *usersetting, *mailnotifications;
 
-	if (!purple_account_get_check_mail(js->gc->account))
+	if (!purple_account_get_check_mail(purple_connection_get_account(js->gc)))
 		return;
 
+	/*
+	 * Quoting http://code.google.com/apis/talk/jep_extensions/usersettings.html:
+	 * To ensure better compatibility with other clients, rather than
+	 * setting this value to "false" to turn off notifications, it is
+	 * recommended that a client set this to "true" and filter incoming
+	 * email notifications itself.
+	 */
+	iq = jabber_iq_new(js, JABBER_IQ_SET);
+	usersetting = xmlnode_new_child(iq->node, "usersetting");
+	xmlnode_set_namespace(usersetting, "google:setting");
+	mailnotifications = xmlnode_new_child(usersetting, "mailnotifications");
+	xmlnode_set_attrib(mailnotifications, "value", "true");
+	jabber_iq_send(iq);
+
 	iq = jabber_iq_new_query(js, JABBER_IQ_GET, "google:mail:notify");
 	jabber_iq_set_callback(iq, jabber_gmail_parse, NULL);
 	jabber_iq_send(iq);


More information about the Commits mailing list