From f86e3e089ff4e4e27133156e277c94d4cd8c7111 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 4 Apr 2018 21:55:36 +0300 Subject: URI refactoring --- .../src/main/java/com/juick/server/MessengerManager.java | 5 +++-- juick-server/src/main/java/com/juick/server/api/Post.java | 10 ++-------- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'juick-server/src/main/java') diff --git a/juick-server/src/main/java/com/juick/server/MessengerManager.java b/juick-server/src/main/java/com/juick/server/MessengerManager.java index 55330c3d..0de3d882 100644 --- a/juick-server/src/main/java/com/juick/server/MessengerManager.java +++ b/juick-server/src/main/java/com/juick/server/MessengerManager.java @@ -19,17 +19,18 @@ import com.juick.service.MessagesService; import com.juick.service.MessengerService; import com.juick.service.SubscriptionService; import com.juick.service.UserService; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; import javax.annotation.Nonnull; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.net.MalformedURLException; +import java.net.URI; import java.net.URL; import java.time.Instant; import java.util.Collections; @@ -97,7 +98,7 @@ public class MessengerManager implements ApplicationListener { logger.info("Received text message from '{}' at '{}' with content: {} (mid: {})", senderId, timestamp, text, messageId); try { - xmppConnection.incomingMessageJuick(user_from, null, text, null); + xmppConnection.incomingMessageJuick(user_from, null, text, URI.create(StringUtils.EMPTY)); } catch (Exception e) { logger.warn("messenger error", e); } diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java index 7c8fb2ea..1dd18b66 100644 --- a/juick-server/src/main/java/com/juick/server/api/Post.java +++ b/juick-server/src/main/java/com/juick/server/api/Post.java @@ -19,9 +19,8 @@ package com.juick.server.api; import com.juick.Status; import com.juick.User; -import com.juick.server.EmailManager; -import com.juick.server.ServerManager; import com.juick.server.CommandsManager; +import com.juick.server.EmailManager; import com.juick.server.XMPPConnection; import com.juick.server.util.*; import com.juick.server.xmpp.helpers.CommandResult; @@ -39,10 +38,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import rocks.xmpp.addr.Jid; -import rocks.xmpp.core.stanza.model.Message; -import rocks.xmpp.extensions.nick.model.Nickname; -import rocks.xmpp.extensions.oob.model.x.OobX; import springfox.documentation.annotations.ApiIgnore; import javax.inject.Inject; @@ -53,7 +48,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; @@ -66,7 +60,7 @@ import java.util.UUID; */ @RestController public class Post { - private static Logger logger = LoggerFactory.getLogger(ServerManager.class); + private static Logger logger = LoggerFactory.getLogger(Post.class); @Inject private UserService userService; -- cgit v1.2.3