Skip to content

Commit

Permalink
fixes #47: Fix ChatBot's rejection message
Browse files Browse the repository at this point in the history
  • Loading branch information
guusdk committed Apr 30, 2021
1 parent 26b268d commit f9bcc98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 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>4.5.0</b> -- tbd</p>
<ul>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/47">#47</a>] - Fix ChatBot's rejection message.</li>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/46">#46</a>] - Allow workgroup's chatbot to be configured in the admin console.</li>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/45">#45</a>] - Fix invalid roomconfig value: moderators (should be: moderator)</li>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/43">#43</a>] - Fix invalid database name for queue properties.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ private ChatSettingsCreator() {
labelMap.put(KeyEnum.email_sent_message, "Email was sent to the user");

botMap.put(KeyEnum.command_accepted_message, "Please stand by for group chat invitation");
labelMap.put(KeyEnum.command_accepted_message, "Comand ok response");
labelMap.put(KeyEnum.command_accepted_message, "Command ok response");

botMap.put(KeyEnum.command_rejected_message, "Command refused");
labelMap.put(KeyEnum.command_rejected_message, "Comand error response");
labelMap.put(KeyEnum.command_rejected_message, "Command error response");

botMap.put(KeyEnum.join_command, "!join");
labelMap.put(KeyEnum.join_command, "Text representing the 'join' command");
Expand Down
12 changes: 8 additions & 4 deletions src/java/org/jivesoftware/xmpp/workgroup/chatbot/Chatbot.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,15 @@ private void acceptRejectOffer(ChatbotSession session, Message message, boolean
AgentSession agentSession = AGENT_MANAGER.getAgentSession(from);

if (agentSession != null) {
if (accept) offer.accept(agentSession);
if (!accept) offer.reject(agentSession);
if (accept) {
offer.accept(agentSession);
sendReply(message, getCommandAcceptedMessage());
}
if (!accept) {
offer.reject(agentSession);
sendReply(message, getCommandRejectedMessage());
}
handled = true;

sendReply(message, getCommandAcceptedMessage());
}
}
} catch (Exception e) {
Expand Down

0 comments on commit f9bcc98

Please sign in to comment.