[knuckles] GMail notifications now always work and are enabled on gajim startup

This commit is contained in:
Nikos Kouremenos 2006-01-18 22:54:07 +00:00
parent 3e68f5c86d
commit 1c5eab53d3
2 changed files with 18 additions and 0 deletions

View File

@ -1421,6 +1421,23 @@ class Connection:
# Get bookmarks from private namespace
self.get_bookmarks()
# If it's a gmail account, inform the server that we want e-mail notifications
if our_jid.split('@')[1] == 'gmail.com':
gajim.log.debug(('%s is a gmail account. Setting option to get e-mail notifications on the server.') % (our_jid))
iq = common.xmpp.Iq(typ = 'set', to = our_jid)
iq.setAttr('id', 'MailNotify')
query = iq.setTag('usersetting')
query.setNamespace(common.xmpp.NS_GTALKSETTING)
query = query.setTag('mailnotifications')
query.setAttr('value', 'true')
self.to_be_sent.append(iq)
# Ask how many messages there are now
iq = common.xmpp.Iq(typ = 'get')
iq.setAttr('id', '13')
query = iq.setTag('query')
query.setNamespace(common.xmpp.NS_GMAILNOTIFY)
self.to_be_sent.append(iq)
#Inform GUI we just signed in
self.dispatch('SIGNED_IN', ())

View File

@ -87,6 +87,7 @@ NS_TLS ='urn:ietf:params:xml:ns:xmpp-tls'
NS_VACATION ='http://jabber.org/protocol/vacation'
NS_VCARD ='vcard-temp'
NS_GMAILNOTIFY ='google:mail:notify'
NS_GTALKSETTING ='google:setting'
NS_VCARD_UPDATE =NS_VCARD+':x:update'
NS_VERSION ='jabber:iq:version'
NS_WAITINGLIST ='http://jabber.org/protocol/waitinglist' # JEP-0130