From 534d3c6f8ab31c0d41e6a6980f8cbc3f25e8d1b9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 5 Apr 2018 14:03:09 +0300 Subject: server: commands are not depended on xmpp now --- .../src/main/java/com/juick/server/XMPPConnection.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'juick-server-xmpp') diff --git a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java index a277a4a4..ffa145d9 100644 --- a/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java +++ b/juick-server-xmpp/src/main/java/com/juick/server/XMPPConnection.java @@ -17,17 +17,13 @@ package com.juick.server; -import com.juick.Tag; import com.juick.User; import com.juick.server.component.LikeEvent; import com.juick.server.component.MessageEvent; import com.juick.server.component.PingEvent; import com.juick.server.component.SubscribeEvent; -import com.juick.server.helpers.UserInfo; -import com.juick.server.util.HttpUtils; -import com.juick.server.util.ImageUtils; -import com.juick.server.util.TagUtils; import com.juick.server.helpers.CommandResult; +import com.juick.server.helpers.UserInfo; import com.juick.server.xmpp.s2s.BasicXmppSession; import com.juick.server.xmpp.s2s.StanzaListener; import com.juick.service.*; @@ -79,7 +75,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -182,11 +177,7 @@ public class XMPPConnection implements StanzaListener, NotificationListener { if (jid.getDomain().equals(router.getDomain().toEscapedString()) || jid.equals(this.jid)) { com.juick.Message jmsg = message.getExtension(com.juick.Message.class); if (jmsg != null) { - if (jid.getLocal().equals("recomm")) { - User fromUser = jmsg.getUser(); - com.juick.Message msg = messagesService.getMessage(jmsg.getMid()); - applicationEventPublisher.publishEvent(new LikeEvent(this, fromUser, msg)); - } else if (jid.getLocal().equals("pm")) { + if (jid.getLocal().equals("pm")) { applicationEventPublisher.publishEvent(new MessageEvent(this, jmsg)); } else { if (jmsg.getRid() > 0) { @@ -600,10 +591,10 @@ public class XMPPConnection implements StanzaListener, NotificationListener { } incomingMessageJuick(user_from, msg.getFrom(), msg.getBody(), attachmentURI); } - public com.juick.Message incomingMessageJuick(User user_from, Jid from, String command, @Nonnull URI attachment) + private void incomingMessageJuick(User user_from, Jid from, String command, @Nonnull URI attachment) throws Exception { if (StringUtils.isBlank(command) && attachment.toString().isEmpty()) { - return null; + return; } int commandlen = command.length(); @@ -617,7 +608,6 @@ public class XMPPConnection implements StanzaListener, NotificationListener { if (StringUtils.isNotBlank(result.getText())) { sendReply(from, result.getText()); } - return result.getNewMessage(); } @Override -- cgit v1.2.3