From 8e3d66492c615af95c7f9421f4b23d95515fc920 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Fri, 4 Sep 2009 14:44:25 +0000 Subject: [PATCH] Renames occurrences of callParticipant to callPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers --- ...ionSetBasicInstantMessagingJabberImpl.java | 22 ++++++------ .../OutgoingFileTransferJabberImpl.java | 12 +++---- .../ProtocolProviderServiceJabberImpl.java | 30 ++++++++++++---- .../mailnotification/MailboxIQProvider.java | 34 +++++++++++++++++-- 4 files changed, 74 insertions(+), 24 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java index ffc59c375..16196f1ce 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java @@ -97,13 +97,6 @@ public class OperationSetBasicInstantMessagingJabberImpl */ private static final String CLOSE_BODY_TAG = ""; - /** - * Contains the time of the last mail result set that we've received from - * the server. We use this time when sending new queries to the server so - * that it won't return messages that we've already shown to our user. - */ - private long lastResultTime = -1; - /** * Creates an instance of this operation set. * @param provider a reference to the ProtocolProviderServiceImpl @@ -654,12 +647,21 @@ public boolean accept(Packet packet) private void subscribeForGmailNotifications() { // first check support for the notification service - boolean notificationsAreSupported = ServiceDiscoveryManager - .getInstanceFor(jabberProvider.getConnection()) - .includesFeature(NewMailNotificationIQ.NAMESPACE); + boolean notificationsAreSupported = jabberProvider.isFeatureSupported( + jabberProvider.getAccountID().getService(), + NewMailNotificationIQ.NAMESPACE); if (!notificationsAreSupported) + { + logger.debug(jabberProvider.getAccountID().getService() + +" does not seem to provide a GMail notification " + +" service so we won't be trying to subscribe for it"); return; + } + + logger.debug(jabberProvider.getAccountID().getService() + +" seems to provide a GMail notification " + +" service so we will try to subscribe for it"); ProviderManager providerManager = ProviderManager.getInstance(); providerManager.addIQProvider( diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java index 5e27494c0..8543cde22 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OutgoingFileTransferJabberImpl.java @@ -21,7 +21,7 @@ /** * The Jabber protocol extension of the AbstractFileTransfer. - * + * * @author Yana Stamcheva */ public class OutgoingFileTransferJabberImpl @@ -84,9 +84,9 @@ public OutgoingFileTransferJabberImpl( && ((ThumbnailedFile) file).getThumbnailData().length > 0) { if (protocolProvider.isFeatureListSupported( - protocolProvider.getFullJid(receiver), - new String[]{"urn:xmpp:thumbs:0", - "urn:xmpp:bob"})) + protocolProvider.getFullJid(receiver), + new String[]{"urn:xmpp:thumbs:0", + "urn:xmpp:bob"})) { protocolProvider.getConnection().addPacketWriterInterceptor( this, @@ -105,7 +105,7 @@ public void cancel() /** * Returns the number of bytes already sent to the recipient. - * + * * @return the number of bytes already sent to the recipient. */ public long getTransferedBytes() @@ -162,7 +162,7 @@ public void removeThumbnailRequestListener() /** * Listens for all StreamInitiation packets and adds a thumbnail * to them if a thumbnailed file is supported. - * + * * @see PacketInterceptor#interceptPacket(Packet) */ public void interceptPacket(Packet packet) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index ac184da48..49239db61 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -644,11 +644,11 @@ protected void initialize(String screenname, OperationSetInstantMessageTransform messageTransform = new OperationSetInstantMessageTransformImpl(); - + supportedOperationSets.put( OperationSetInstantMessageTransform.class.getName(), messageTransform); - + // Include features we're supporting in plus of the four that // included by smack itself: // http://jabber.org/protocol/si/profile/file-transfer @@ -867,14 +867,16 @@ JabberStatusEnum getJabberStatusEnum() } /** - * Checks if the given list of features is supported by the given - * jabber id. + * Determines if the given list of features is supported by the + * specified jabber id. + * * @param jid the jabber id for which to check * @param features the list of features to check for + * * @return true if the list of features is supported, otherwise * returns false */ - boolean isFeatureListSupported(String jid, String[] features) + public boolean isFeatureListSupported(String jid, String[] features) { boolean isFeatureListSupported = true; @@ -903,10 +905,26 @@ boolean isFeatureListSupported(String jid, String[] features) return isFeatureListSupported; } + /** + * Determines if the given list of features is supported by the + * specified jabber id. + * + * @param jid the jabber id that we'd like to get information about + * @param feature the feature to check for + * + * @return true if the list of features is supported, otherwise + * returns false + */ + public boolean isFeatureSupported(String jid, String feature) + { + return isFeatureListSupported(jid, new String[]{feature}); + } + /** * Returns the full jabber id (jid) corresponding to the given contact. + * * @param contact the contact, for which we're looking for a jid - * @return the jid + * @return the jid of the specified contact; */ String getFullJid(Contact contact) { diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/mailnotification/MailboxIQProvider.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/mailnotification/MailboxIQProvider.java index 016a4a3fb..4334a33e0 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/mailnotification/MailboxIQProvider.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/mailnotification/MailboxIQProvider.java @@ -54,8 +54,38 @@ public IQ parseIQ(final XmlPullParser parser) throws Exception parser.getAttributeValue("", "total-estimate"))); mailboxIQ.setUrl(parser.getAttributeValue("", "url")); - int eventType = parser.next(); - String name = parser.getName(); + + boolean done = false; + while(!done) + { + int eventType = parser.next(); + if (eventType == XmlPullParser.START_TAG) + { + String name = parser.getName(); + if(parser.getName().equals("mail-thread-info")) + { + + } + + } + else if (eventType == XmlPullParser.END_TAG) + { + if (parser.getName().equals("field")) + { + done = true; + } + } + else + { + if(logger.isTraceEnabled()) + { + logger.trace("xml parser returned eventType=" + eventType); + logger.trace("parser="+parser); + } + } + } + int eventType = 1; + String name = null; if (eventType == XmlPullParser.START_TAG) { if ("mail-thread-info".equals(name))