Skip to content

Commit

Permalink
fix #4 - llama user to join chat room not working
Browse files Browse the repository at this point in the history
  • Loading branch information
deleolajide committed Dec 20, 2023
1 parent 65cdcd2 commit 9f95119
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>
<p><b>0.0.2</b> -- December 31, 2023</p>

<ul>
<li>Fix bug with groupchat messages</li>
<li>Upgraded to latest llama binaries</li>
<li>Add vcard-temp support for LLaMA user</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/ifsoft/llama/openfire/LLaMA.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void messageReceived(JID roomJID, JID user, String nickname, Message mess
Thread.sleep(1000);
}

llamaConnection.handlePrediction(body, roomJID, message.getType());
//llamaConnection.handlePrediction(body, roomJID, message.getType());
}
} catch (Exception e) {
Log.error("unable to handle groupchat message", e);
Expand Down
14 changes: 13 additions & 1 deletion src/java/org/ifsoft/llama/openfire/LLaMAConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,19 @@ public void deliver(Packet packet) throws UnauthorizedException {

if (!isNull(msg) && !isNull(from) /*&& SessionManager.getInstance().getSessions(from).size() > 0*/)
{
handlePrediction(msg, packet.getFrom(), message.getType());
JID requestor = packet.getFrom();

if (message.getType() == Message.Type.groupchat) {
final String llamaUser = JiveGlobals.getProperty("llama.username", "llama");

if (msg.toLowerCase().startsWith(llamaUser.toLowerCase())) {
requestor = new JID(packet.getFrom().toBareJID());
handlePrediction(msg, requestor, message.getType());
}

} else {
handlePrediction(msg, requestor, message.getType());
}
}
}
}
Expand Down

0 comments on commit 9f95119

Please sign in to comment.