Commit 28ea6969 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Updating Live Assistant 2.0 Server to check for ChatBots


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@200 b35dd754-fafc-0310-a699-88a17e54d16e
parent 408fd4e5
...@@ -37,12 +37,19 @@ public class IQRouterImpl extends BasicModule implements IQRouter { ...@@ -37,12 +37,19 @@ public class IQRouterImpl extends BasicModule implements IQRouter {
public RoutingTable routingTable; public RoutingTable routingTable;
public LinkedList iqHandlers = new LinkedList(); public LinkedList iqHandlers = new LinkedList();
private HashMap namespace2Handlers = new HashMap(); private HashMap namespace2Handlers = new HashMap();
private ChatbotManager chatBotManager;
/** /**
* Creates a packet router. * Creates a packet router.
*/ */
public IQRouterImpl() { public IQRouterImpl() {
super("XMPP IQ Router"); super("XMPP IQ Router");
try {
chatBotManager = (ChatbotManager)ServiceLookupFactory.getLookup().lookup(ChatbotManager.class);
}
catch (UnauthorizedException e) {
Log.error(e);
}
} }
public void route(IQ packet) { public void route(IQ packet) {
...@@ -75,15 +82,10 @@ public class IQRouterImpl extends BasicModule implements IQRouter { ...@@ -75,15 +82,10 @@ public class IQRouterImpl extends BasicModule implements IQRouter {
|| "".equals(recipientJID.getHost()) || recipientJID.getResource() == null || "".equals(recipientJID.getHost()) || recipientJID.getResource() == null
|| "".equals(recipientJID.getResource()); || "".equals(recipientJID.getResource());
try {
if(recipientJID != null){ if(recipientJID != null){
ChatbotManager chatBotManager = (ChatbotManager)ServiceLookupFactory.getLookup().lookup(ChatbotManager.class);
isLocalServer = !chatBotManager.isChatbot(recipientJID); isLocalServer = !chatBotManager.isChatbot(recipientJID);
} }
}
catch (UnauthorizedException e) {
e.printStackTrace();
}
return isLocalServer; return isLocalServer;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment