This repository has been archived by the owner on May 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
191 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package protocol.xmpp; | ||
|
||
/** | ||
* Created by gerc on 12.03.2015. | ||
*/ | ||
public interface OnIqReceived { | ||
public void onIqReceived(XmlNode xmlNode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package protocol.xmpp; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* Created by gerc on 12.03.2015. | ||
*/ | ||
public class ServerFeatures { | ||
private HashMap<String, String> serverDiscoItems = new HashMap<>(); | ||
private String mucServer; | ||
private boolean hasMessageArchiveManagement; | ||
private boolean hasCarbon; | ||
private boolean carbonsEnabled; | ||
|
||
public void parse(XmlNode iqQuery, String id) { | ||
while (0 < iqQuery.childrenCount()) { | ||
XmlNode featureNode = iqQuery.popChildNode(); | ||
String feature = featureNode.getAttribute("var"); | ||
if (feature != null) { | ||
if (feature.equals("http://jabber.org/protocol/muc")) { | ||
mucServer = serverDiscoItems.get(id); | ||
} else if (feature.equals("urn:xmpp:mam:0")) { | ||
hasMessageArchiveManagement = true; | ||
} else if (feature.equals("urn:xmpp:carbons:2")) { | ||
hasCarbon = true; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public boolean hasMessageArchiveManagement() { | ||
return hasMessageArchiveManagement; | ||
} | ||
|
||
public HashMap<String, String> getServerDiscoItems() { | ||
return serverDiscoItems; | ||
} | ||
|
||
public String mucServer() { | ||
return mucServer; | ||
} | ||
|
||
public boolean hasCarbon() { | ||
return hasCarbon; | ||
} | ||
|
||
public boolean isCarbonsEnabled() { | ||
return carbonsEnabled; | ||
} | ||
|
||
public void setCarbonsEnabled(boolean carbonsEnabled) { | ||
this.carbonsEnabled = carbonsEnabled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.