From c7c2b377642a337edc303756836c9f0843cdc145 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Mon, 21 May 2018 15:50:36 +0300
Subject: juick.com/m/ links
---
.../src/main/java/com/juick/formatters/PlainTextFormatter.java | 4 ++--
juick-common/src/main/java/com/juick/server/CommandsManager.java | 4 ++--
juick-common/src/main/java/com/juick/util/MessageUtils.java | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
(limited to 'juick-common/src/main/java')
diff --git a/juick-common/src/main/java/com/juick/formatters/PlainTextFormatter.java b/juick-common/src/main/java/com/juick/formatters/PlainTextFormatter.java
index 7275a9da..91748684 100644
--- a/juick-common/src/main/java/com/juick/formatters/PlainTextFormatter.java
+++ b/juick-common/src/main/java/com/juick/formatters/PlainTextFormatter.java
@@ -77,11 +77,11 @@ public class PlainTextFormatter {
public static String formatUrl(com.juick.Message jmsg) {
if (MessageUtils.isReply(jmsg)) {
- return String.format("https://juick.com/%d#%d", jmsg.getMid(), jmsg.getRid());
+ return String.format("https://juick.com/m/%d#%d", jmsg.getMid(), jmsg.getRid());
} else if (MessageUtils.isPM(jmsg)) {
return "https://juick.com/pm/inbox";
}
- return "https://juick.com/" + jmsg.getMid();
+ return "https://juick.com/m/" + jmsg.getMid();
}
public static String formatPostNumber(com.juick.Message jmsg) {
diff --git a/juick-common/src/main/java/com/juick/server/CommandsManager.java b/juick-common/src/main/java/com/juick/server/CommandsManager.java
index 4b32c456..3ba071e2 100644
--- a/juick-common/src/main/java/com/juick/server/CommandsManager.java
+++ b/juick-common/src/main/java/com/juick/server/CommandsManager.java
@@ -118,7 +118,7 @@ public class CommandsManager {
com.juick.Message msg = messagesService.getMessage(mid);
applicationEventPublisher.publishEvent(new MessageReadEvent(this, user, msg));
applicationEventPublisher.publishEvent(new MessageEvent(this, msg, subscriptionService.getSubscribedUsers(msg.getUser().getUid(), msg.getMid())));
- return CommandResult.build(msg, "New message posted.\n#" + msg.getMid() + " https://juick.com/" + msg.getMid(), String.format("[New message](%s) posted", PlainTextFormatter.formatUrl(msg)));
+ return CommandResult.build(msg, "New message posted.\n#" + msg.getMid() + " https://juick.com/m/" + msg.getMid(), String.format("[New message](%s) posted", PlainTextFormatter.formatUrl(msg)));
}
@UserCommand(pattern = "^ping$", patternFlags = Pattern.CASE_INSENSITIVE,
@@ -506,7 +506,7 @@ public class CommandsManager {
Message reply = messagesService.getReply(mid, newrid);
applicationEventPublisher.publishEvent(new MessageEvent(this, reply, subscriptionService.getUsersSubscribedToComments(original, reply)));
return CommandResult.build(reply,"Reply posted.\n#" + mid + "/" + newrid + " "
- + "https://juick.com/" + mid + "#" + newrid,
+ + "https://juick.com/m/" + mid + "#" + newrid,
String.format("[Reply](%s) posted", PlainTextFormatter.formatUrl(reply)));
}
}
diff --git a/juick-common/src/main/java/com/juick/util/MessageUtils.java b/juick-common/src/main/java/com/juick/util/MessageUtils.java
index c9796809..0da7310e 100644
--- a/juick-common/src/main/java/com/juick/util/MessageUtils.java
+++ b/juick-common/src/main/java/com/juick/util/MessageUtils.java
@@ -109,11 +109,11 @@ public class MessageUtils {
// #12345
// #12345
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1#$2$3");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1#$2$3");
// #12345/65
// #12345/65
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1#$2/$3$4");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1#$2/$3$4");
// *bold*
// bold
--
cgit v1.2.3