[knuckles] GMail notifications now always work and are enabled on gajim startup
This commit is contained in:
parent
3e68f5c86d
commit
1c5eab53d3
|
@ -1421,6 +1421,23 @@ class Connection:
|
||||||
|
|
||||||
# Get bookmarks from private namespace
|
# Get bookmarks from private namespace
|
||||||
self.get_bookmarks()
|
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
|
#Inform GUI we just signed in
|
||||||
self.dispatch('SIGNED_IN', ())
|
self.dispatch('SIGNED_IN', ())
|
||||||
|
|
|
@ -87,6 +87,7 @@ NS_TLS ='urn:ietf:params:xml:ns:xmpp-tls'
|
||||||
NS_VACATION ='http://jabber.org/protocol/vacation'
|
NS_VACATION ='http://jabber.org/protocol/vacation'
|
||||||
NS_VCARD ='vcard-temp'
|
NS_VCARD ='vcard-temp'
|
||||||
NS_GMAILNOTIFY ='google:mail:notify'
|
NS_GMAILNOTIFY ='google:mail:notify'
|
||||||
|
NS_GTALKSETTING ='google:setting'
|
||||||
NS_VCARD_UPDATE =NS_VCARD+':x:update'
|
NS_VCARD_UPDATE =NS_VCARD+':x:update'
|
||||||
NS_VERSION ='jabber:iq:version'
|
NS_VERSION ='jabber:iq:version'
|
||||||
NS_WAITINGLIST ='http://jabber.org/protocol/waitinglist' # JEP-0130
|
NS_WAITINGLIST ='http://jabber.org/protocol/waitinglist' # JEP-0130
|
||||||
|
|
Loading…
Reference in New Issue