/** * Creates an instance of this operation set. * * @param provider a reference to the <tt>ProtocolProviderServiceImpl</tt> that created us and * that we'll use for retrieving the underlying aim connection. */ OperationSetBasicInstantMessagingJabberImpl(ProtocolProviderServiceJabberImpl provider) { this.jabberProvider = provider; packetFilters.add(new GroupMessagePacketFilter()); packetFilters.add(new PacketTypeFilter(org.jivesoftware.smack.packet.Message.class)); provider.addRegistrationStateChangeListener(new RegistrationStateListener()); ProviderManager man = ProviderManager.getInstance(); MessageCorrectionExtensionProvider extProvider = new MessageCorrectionExtensionProvider(); man.addExtensionProvider( MessageCorrectionExtension.ELEMENT_NAME, MessageCorrectionExtension.NAMESPACE, extProvider); }
/** * Returns the data form as List of PacketExtensions, or null if no data form is set. This * representation is needed by some classes (e.g. EntityCapsManager, NodeInformationProvider) * * @return */ public List<PacketExtension> getExtendedInfoAsList() { List<PacketExtension> res = null; if (extendedInfo != null) { res = new ArrayList<PacketExtension>(1); res.add(extendedInfo); } return res; }
/** * Registers that a new feature is supported by this XMPP entity. When this client is queried for * its information the registered features will be answered. * * <p>Since no packet is actually sent to the server it is safe to perform this operation before * logging to the server. In fact, you may want to configure the supported features before logging * to the server so that the information is already available if it is required upon login. * * @param feature the feature to register as supported. */ public void addFeature(String feature) { synchronized (features) { features.add(feature); renewEntityCapsVersion(); } }
/** * Registers that a new feature is supported by this XMPP entity. When this client is queried for * its information the registered features will be answered. * * <p>Since no packet is actually sent to the server it is safe to perform this operation before * logging to the server. In fact, you may want to configure the supported features before logging * to the server so that the information is already available if it is required upon login. * * @param feature the feature to register as supported. */ public void addFeature(String feature) { synchronized (features) { features.add(feature); } }
/** * Adds a specific <tt>UserCapsNodeListener</tt> to the list of <tt>UserCapsNodeListener</tt>s * interested in events notifying about changes in the list of user caps nodes of this * <tt>EntityCapsManager</tt>. * * @param listener the <tt>UserCapsNodeListener</tt> which is interested in events notifying about * changes in the list of user caps nodes of this <tt>EntityCapsManager</tt> */ public void addUserCapsNodeListener(UserCapsNodeListener listener) { if (listener == null) throw new NullPointerException("listener"); synchronized (userCapsNodeListeners) { if (!userCapsNodeListeners.contains(listener)) userCapsNodeListeners.add(listener); } }