aboutsummaryrefslogtreecommitdiff
path: root/juick-common
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common')
-rw-r--r--juick-common/src/main/java/com/juick/formatters/PlainTextFormatter.java4
-rw-r--r--juick-common/src/main/java/com/juick/server/CommandsManager.java4
-rw-r--r--juick-common/src/main/java/com/juick/util/MessageUtils.java4
3 files changed, 6 insertions, 6 deletions
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
// <a href="http://juick.com/12345">#12345</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1<a href=\"http://juick.com/$2\">#$2</a>$3");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)((?=\\s)|(?=\\Z)|(?=\\))|(?=\\.)|(?=\\,))", "$1<a href=\"http://juick.com/m/$2\">#$2</a>$3");
// #12345/65
// <a href="http://juick.com/12345#65">#12345/65</a>
- msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://juick.com/$2#$3\">#$2/$3</a>$4");
+ msg = msg.replaceAll("((?<=\\s)|(?<=\\A)|(?<=\\p{Punct}))#(\\d+)/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))", "$1<a href=\"http://juick.com/m/$2#$3\">#$2/$3</a>$4");
// *bold*
// <b>bold</b>