Renames occurrences of callParticipant to callPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers

cusax-fix
Emil Ivov 17 years ago
parent 82ffcb1cab
commit 55b2e1fd57

@ -9,6 +9,7 @@
import java.util.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.keepalive.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.mailnotification.*;
import net.java.sip.communicator.impl.protocol.jabber.extensions.version.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.Message;
@ -22,7 +23,7 @@
import org.jivesoftware.smack.provider.*;
import org.jivesoftware.smack.util.*;
import org.jivesoftware.smackx.*;
import org.jivesoftware.smackx.packet.XHTMLExtension;
import org.jivesoftware.smackx.packet.*;
/**
* A straightforward implementation of the basic instant messaging operation
@ -286,7 +287,7 @@ private class RegistrationStateListener
implements RegistrationStateChangeListener
{
/**
* The method is called by a ProtocolProvider implementation whenver
* The method is called by a ProtocolProvider implementation whenever
* a change in the registration state of the corresponding provider had
* occurred.
* @param evt ProviderStatusChangeEvent the event describing the status
@ -311,7 +312,12 @@ public void registrationStateChanged(RegistrationStateChangeEvent evt)
new PacketTypeFilter(
org.jivesoftware.smack.packet.Message.class)}));
// run keepalive thread
//subscribe for Google (GMail or Google Apps) notifications
//for new mail messages.
subscribeForGmailNotifications();
// run keep alive thread
if(keepAliveSendTask == null && keepAliveEnabled)
{
jabberProvider.getConnection().addPacketListener(
@ -625,4 +631,67 @@ public boolean accept(Packet packet)
return true;
}
}
/**
* Subscribes this provider as interested in receiving notifications for
* new mail messages from Google mail services such as GMail or Google Apps.
*/
private void subscribeForGmailNotifications()
{
//------listerner mail
try
{
// with discovered info, we can check if the remote clients
// supports e-mail but not if he don't, because
// a non conforming client can supports a feature
// without advertising it.
//So we don't rely on it (for the moment)
DiscoverInfo di = ServiceDiscoveryManager
.getInstanceFor(jabberProvider.getConnection())
.discoverInfo(jabberProvider.getAccountID()
.getAccountAddress());
if (di.containsFeature(
"http://jabber.org/protocol/disco#info"))
{
ProviderManager providerManager =
ProviderManager.getInstance();
providerManager.addIQProvider(
"mailbox", "google:mail:notify",
new MailboxProvider());
providerManager.addIQProvider(
"new-mail", "google:mail:notify",
new NewMailNotificationProvider());
jabberProvider.getConnection().addPacketListener(
new MailNotificationListener(),
new PacketTypeFilter(
IQ.class));
jabberProvider.getConnection().addPacketListener(
new NewMailNotificationListener(),
new PacketTypeFilter(
IQ.class));
if(opSetPersPresence.getCurrentStatusMessage()
.equals(JabberStatusEnum.OFFLINE))
return;
QueryNotify mailnotification = new QueryNotify(lastResultTime);
logger.trace(
"send mailNotification for acc: "
+ jabberProvider.getAccountID().getAccountUniqueID());
jabberProvider.getConnection().sendPacket(mailnotification);
}
}
catch (XMPPException ex)
{
logger.warn("could not retrieve info for "+
jabberProvider.getAccountID().getAccountAddress(),
ex);
}
}
}

@ -27,28 +27,18 @@ public class NewMailNotification extends IQ
Logger.getLogger(NewMailNotification.class);
/**
* The content of the new mail element
* The name space for new mail notification packets.
*/
private String xmls;
public static final String NAMESPACE = "google:mail:notify";
/**
* Returns the xmls value of the new-mail element
* Returns the name space of the new-mail element
*
* @return the xmls value of the new-mail element.
* @return the XML name space of the new-mail element.
*/
public String getNmnxmls()
public String getXmlsns()
{
return xmls;
}
/**
* Sets the xmls value
*
* @param xmls the xmls String
*/
public void setNmnxmls(String xmls)
{
this.xmls = xmls;
return NAMESPACE;
}
/**

@ -48,15 +48,6 @@ public IQ parseIQ(final XmlPullParser parser) throws Exception
iq.setTo(parser.getAttributeValue("", "to"));
iq.setPacketID(parser.getAttributeValue("", "id"));
int eventType = parser.next();
String name = parser.getName();
if (eventType == XmlPullParser.START_TAG)
{
if ("new-mail".equals(name))
{
iq.setNmnxmls(parser.getAttributeValue("", "xmlns"));
}
}
return iq;
}
}

Loading…
Cancel
Save