diff options
author | 2020-03-07 13:20:45 +0300 | |
---|---|---|
committer | 2020-03-07 13:20:45 +0300 | |
commit | c9d67837cbcaae84a03b7bd14e508ca62880f87f (patch) | |
tree | 0f66e38f5b6aa48c66fae7d10c0b8b5ad6f7e7e2 /src/main/java/com/juick/server/XMPPManager.java | |
parent | ad50d1090b303d3a71c354dd2922a982fda6a289 (diff) |
Reorganize project layout
Diffstat (limited to 'src/main/java/com/juick/server/XMPPManager.java')
-rw-r--r-- | src/main/java/com/juick/server/XMPPManager.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/com/juick/server/XMPPManager.java b/src/main/java/com/juick/server/XMPPManager.java index 94fe0d1e..5c58345a 100644 --- a/src/main/java/com/juick/server/XMPPManager.java +++ b/src/main/java/com/juick/server/XMPPManager.java @@ -17,7 +17,7 @@ package com.juick.server; -import com.juick.User; +import com.juick.model.User; import com.juick.formatters.PlainTextFormatter; import com.juick.model.CommandResult; import com.juick.server.api.SystemActivity; @@ -126,7 +126,7 @@ public class XMPPManager implements NotificationListener { public void init() { logger.info("xmpp component start connecting to {}", componentPort); XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() - .extensions(Extension.of(com.juick.Message.class), Extension.of(MessageQuery.class)) + .extensions(Extension.of(com.juick.model.Message.class), Extension.of(MessageQuery.class)) .debugger(LogbackDebugger.class) .defaultResponseTimeout(Duration.ofMillis(120000)) .build(); @@ -269,13 +269,13 @@ public class XMPPManager implements NotificationListener { serviceUser = userService.getUserByName(serviceUsername); } - private void sendJuickMessage(com.juick.Message jmsg, List<User> users) { + private void sendJuickMessage(com.juick.model.Message jmsg, List<User> users) { List<String> jids = new ArrayList<>(); for (User user : users) { jids.addAll(userService.getJIDsbyUID(user.getUid())); } - com.juick.Message fullMsg = messagesService.getMessage(jmsg.getMid()).orElseThrow(IllegalStateException::new); + com.juick.model.Message fullMsg = messagesService.getMessage(jmsg.getMid()).orElseThrow(IllegalStateException::new); String txt = "@" + jmsg.getUser().getName() + ":" + MessageUtils.getTagsString(fullMsg) + "\n"; String attachmentUrl = MessageUtils.attachmentUrl(fullMsg); if (StringUtils.isNotEmpty(attachmentUrl)) { @@ -307,14 +307,14 @@ public class XMPPManager implements NotificationListener { } } - private void sendJuickComment(com.juick.Message jmsg, List<User> users) { + private void sendJuickComment(com.juick.model.Message jmsg, List<User> users) { String replyQuote; String replyTo; - com.juick.Message replyMessage = jmsg.getReplyto() > 0 ? messagesService.getReply(jmsg.getMid(), jmsg.getReplyto()) + com.juick.model.Message replyMessage = jmsg.getReplyto() > 0 ? messagesService.getReply(jmsg.getMid(), jmsg.getReplyto()) : messagesService.getMessage(jmsg.getMid()).orElseThrow(IllegalStateException::new); replyTo = replyMessage.getUser().getName(); - com.juick.Message fullReply = messagesService.getReply(jmsg.getMid(), jmsg.getRid()); + com.juick.model.Message fullReply = messagesService.getReply(jmsg.getMid(), jmsg.getRid()); replyQuote = StringUtils.defaultString(fullReply.getReplyQuote()); String txt = "Reply by @" + jmsg.getUser().getName() + ":\n" + replyQuote + "\n@" + replyTo + " "; @@ -351,7 +351,7 @@ public class XMPPManager implements NotificationListener { } } } - private void processMessage(com.juick.Message msg, List<User> subscribers) { + private void processMessage(com.juick.model.Message msg, List<User> subscribers) { if (msg.isService()) { return; } @@ -388,7 +388,7 @@ public class XMPPManager implements NotificationListener { return ClientMessage.from(reply); } - public void processLike(User liker, com.juick.Message jmsg, List<User> users) { + public void processLike(User liker, com.juick.model.Message jmsg, List<User> users) { if (!userService.isInBLAny(jmsg.getUser().getUid(), liker.getUid())) { userService.getJIDsbyUID(jmsg.getUser().getUid()).forEach(authorJid -> { Message xmppMessage = new Message(); @@ -456,7 +456,7 @@ public class XMPPManager implements NotificationListener { }); } - public void processTop(com.juick.Message message) { + public void processTop(com.juick.model.Message message) { try { commandsManager.processCommand(serviceUser, String.format("! #%d", message.getMid()), URI.create(StringUtils.EMPTY)); } catch (Exception e) { |