Ejemplo n.º 1
0
  static {
    registerSmackProviders();
    DNSUtil.setDNSResolver(DNSJavaResolver.getInstance());

    // initialize smack defaults before any connections are created
    SmackConfiguration.setPacketReplyTimeout(PACKET_TIMEOUT);
    SmackConfiguration.setDefaultPingInterval(0);
  }
Ejemplo n.º 2
0
 private boolean checkIfPrivacyIsSupported(XMPPConnection conn) {
   ServiceDiscoveryManager servDisc = ServiceDiscoveryManager.getInstanceFor(conn);
   DiscoverInfo info = null;
   try {
     String xmppHost = DNSUtil.resolveXMPPDomain(conn.getServiceName()).getHost();
     info = servDisc.discoverInfo(xmppHost);
   } catch (XMPPException e) {
     // We could not query the server
     return false;
   }
   if (info != null) {
     for (Iterator<Feature> i = info.getFeatures(); i.hasNext(); ) {
       String s = i.next().getVar();
       if (s.contains("jabber:iq:privacy")) {
         return true;
       }
     }
   }
   return false;
 }
Ejemplo n.º 3
0
 void maybeResolveDns() throws Exception {
   if (!useDnsSrvRr) return;
   hostAddresses = DNSUtil.resolveXMPPDomain(serviceName);
 }
Ejemplo n.º 4
0
 static {
   registerSmackProviders();
   DNSUtil.setDNSResolver(DNSJavaResolver.getInstance());
   SmackConfiguration.setPacketReplyTimeout(PACKET_TIMEOUT);
   SmackConfiguration.setDefaultPingInterval(0);
 }