Hi!
Email notifications from gmail were not working for me. I’ve tried this and then it works. Were they working for you before?
In http://code.google.com/apis/talk/jep_extensions/gmail.html#requestmail it says that to ask for email notifications you have to send something like:
<iq type=‘get’
to=‘romeo@gmail.com’ >… </iq>
But you send:
<iq type=‘get’
to=‘romeo’ >…</iq>
I’ve tried this fix and then they work. Were they working for you before?
=== modified file 'src/java/org/jivesoftware/openfire/gateway/protocols/xmpp/XMPPSession.java' *** src/java/org/jivesoftware/openfire/gateway/protocols/xmpp/XMPPSession.java 2007-09-16 04:41:09 +0000
+++ src/java/org/jivesoftware/openfire/gateway/protocols/xmpp/XMPPSession.java 2007-09-17 15:17:46 +0000
@@ -153,10 +153,19 @@
syncUsers(); if (getTransport().getType().equals(TransportType.gtalk) && JiveGlobals.getBooleanProperty("plugin.gateway.gtalk.mailnotifications", true)) {
* conn.sendPacket(new IQWithPacketExtension(getRegistration().getUsername(), new GoogleUserSettingExtension(false, true, false), IQ.Type.SET));
* conn.sendPacket(new IQWithPacketExtension(getRegistration().getUsername(), new GoogleRelayExtension()));
* conn.sendPacket(new IQWithPacketExtension(getRegistration().getUsername(), new GoogleMailNotifyExtension()));
* conn.sendPacket(new IQWithPacketExtension(getRegistration().getUsername(), new GoogleSharedStatusExtension()));
+
+ String username_for_google = registration.getUsername();
+ // In <iq> [http://code.google.com/apis/talk/jep_extensions/gmail.html#requestmail]
+ // says that you have to use the full jid:
+ // <iq type='get' to='romeo@gmail.com' >... </iq>
+ if (registration.getUsername().indexOf("@") < 0 ) {
+ username_for_google = username_for_google + "@gmail.com";
+ }
+
+ conn.sendPacket(new IQWithPacketExtension(username_for_google, new GoogleUserSettingExtension(false, true, false), IQ.Type.SET));
+ conn.sendPacket(new IQWithPacketExtension(username_for_google, new GoogleRelayExtension()));
+ conn.sendPacket(new IQWithPacketExtension(username_for_google, new GoogleMailNotifyExtension()));
+ conn.sendPacket(new IQWithPacketExtension(username_for_google, new GoogleSharedStatusExtension()));
mailCheck = new MailCheck();
timer.schedule(mailCheck, timerInterval, timerInterval);
}
@@ -403,10 +412,17 @@
*/ public void run() {
if (getTransport().getType().equals(TransportType.gtalk) && JiveGlobals.getBooleanProperty("plugin.gateway.gtalk.mailnotifications", true)) {
+ String username_for_google = registration.getUsername();
+ // In <iq> [http://code.google.com/apis/talk/jep_extensions/gmail.html#requestmail]
+ // says that you have to use the full jid:
+ // <iq type='get' to='romeo@gmail.com' >... </iq>
+ if (registration.getUsername().indexOf("@") < 0 ) {
+ username_for_google = username_for_google + "@gmail.com";
+ }
GoogleMailNotifyExtension gmne = new GoogleMailNotifyExtension();
gmne.setNewerThanTime(listener.getLastGMailThreadDate());
gmne.setNewerThanTid(listener.getLastGMailThreadId());
* conn.sendPacket(new IQWithPacketExtension(getRegistration().getUsername(), gmne)); + conn.sendPacket(new IQWithPacketExtension(username_for_google, gmne));
}
}
}
UPDATE: I’ve updated the format as suggested, with . Thanks!!