From cf0137083ce96f8d26e7670332c766a6c7d75faf Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Apr 2018 17:47:45 +0300 Subject: xmpp: warning message for outdated query --- .../com/juick/server/configuration/BaseWebConfiguration.java | 3 ++- .../src/main/java/com/juick/server/xmpp/iq/MessageQuery.java | 10 ++++++++++ .../src/main/java/com/juick/server/xmpp/iq/package-info.java | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 juick-common/src/main/java/com/juick/server/xmpp/iq/MessageQuery.java create mode 100644 juick-common/src/main/java/com/juick/server/xmpp/iq/package-info.java (limited to 'juick-common/src/main/java/com') diff --git a/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java b/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java index 6bdb819f..5880fd5c 100644 --- a/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java +++ b/juick-common/src/main/java/com/juick/server/configuration/BaseWebConfiguration.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.juick.server.xmpp.JidConverter; +import com.juick.server.xmpp.iq.MessageQuery; import com.juick.server.xmpp.s2s.BasicXmppSession; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -87,7 +88,7 @@ public class BaseWebConfiguration implements WebMvcConfigurer, SchedulingConfigu @Bean public BasicXmppSession session() { XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() - .extensions(Extension.of(com.juick.Message.class)) + .extensions(Extension.of(com.juick.Message.class), Extension.of(MessageQuery.class)) .debugger(LogbackDebugger.class) .build(); return BasicXmppSession.create(hostname, configuration); diff --git a/juick-common/src/main/java/com/juick/server/xmpp/iq/MessageQuery.java b/juick-common/src/main/java/com/juick/server/xmpp/iq/MessageQuery.java new file mode 100644 index 00000000..7500cbf8 --- /dev/null +++ b/juick-common/src/main/java/com/juick/server/xmpp/iq/MessageQuery.java @@ -0,0 +1,10 @@ +package com.juick.server.xmpp.iq; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "query") +public class MessageQuery { + private MessageQuery() { + + } +} diff --git a/juick-common/src/main/java/com/juick/server/xmpp/iq/package-info.java b/juick-common/src/main/java/com/juick/server/xmpp/iq/package-info.java new file mode 100644 index 00000000..dada8289 --- /dev/null +++ b/juick-common/src/main/java/com/juick/server/xmpp/iq/package-info.java @@ -0,0 +1,8 @@ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlSchema(namespace = "http://juick.com/query#messages", elementFormDefault = XmlNsForm.QUALIFIED) +package com.juick.server.xmpp.iq; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlNsForm; +import javax.xml.bind.annotation.XmlSchema; \ No newline at end of file -- cgit v1.2.3