Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bug fix. #71

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ <h1>

<p><b>4.5.2</b> -- (To be determined)</p>
<ul>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/59">#59</a>] - Error starting service after xStream upgrade to 1.4.18</li>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/72">#72</a>] - NullPointerException when chatbot is not enabled.</li>
<li>[<a href="https://github.com/igniterealtime/openfire-fastpath-plugin/issues/73">#73</a>] - Custom dispatcher must be first.</li>
</ul>

<p><b>4.5.1</b> -- September 12, 2024</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public DataForm getDataForm(Workgroup workgroup) {
if (form != null) {
XStream xstream = new XStream();
xstream.setClassLoader(this.getClass().getClassLoader());

try {
return (DataForm) xstream.fromXML(form);
}
Expand All @@ -209,6 +208,11 @@ private void loadWebForms() {
if (form != null) {
XStream xstream = new XStream();
xstream.setClassLoader(this.getClass().getClassLoader());
xstream.allowTypes(new Class[] {
WorkgroupForm.class,
FormElement.class

});

try {
Object object = xstream.fromXML(form);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public static String getUpdateMessage(boolean successfull, String message) {
public synchronized static List<Class<? extends Dispatcher>> getAvailableDispatcherClasses() {
final List<Class<? extends Dispatcher>> result = new ArrayList<>();

// First, add in build-in list of dispatchers.
result.addAll(getBuiltInDispatcherClasses());

// Now get custom algorithms.
Expand All @@ -148,6 +147,8 @@ public synchronized static List<Class<? extends Dispatcher>> getAvailableDispatc
Log.error("An exception occurred while trying to load class with name '{}' from property 'dispatcher.classes'", className, e);
}
}
// Last, add in build-in list of dispatchers.when have custom dispatcher classes set first.
result.addAll(getBuiltInDispatcherClasses());
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.jivesoftware.util.StringUtils;
import org.jivesoftware.xmpp.workgroup.AgentSession;
import org.jivesoftware.xmpp.workgroup.Offer;
import org.jivesoftware.xmpp.workgroup.chatbot.Chatbot;
import org.jivesoftware.xmpp.workgroup.RequestQueue;
import org.jivesoftware.xmpp.workgroup.Workgroup;
import org.jivesoftware.xmpp.workgroup.utils.FastpathConstants;
Expand Down Expand Up @@ -239,7 +240,11 @@ public boolean sendOffer(AgentSession session, RequestQueue queue) {
offerElement.add(getSessionElement());
addOfferContent(offerElement);

queue.getWorkgroup().getChatBot().makeOffer(requestID, session.getJID(), getUserJID().toString());
Chatbot chatbot=queue.getWorkgroup().getChatBot();
if(chatbot!=null) {
chatbot.makeOffer(requestID, session.getJID(), getUserJID().toString());
}

return session.sendOffer(offer, offerPacket);
}

Expand Down