aboutsummaryrefslogtreecommitdiff
path: root/juick-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'juick-core/src/main')
-rw-r--r--juick-core/src/main/java/com/juick/server/SubscriptionsQueries.java2
-rw-r--r--juick-core/src/main/java/com/juick/server/protocol/JuickProtocol.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/juick-core/src/main/java/com/juick/server/SubscriptionsQueries.java b/juick-core/src/main/java/com/juick/server/SubscriptionsQueries.java
index 21a07e05..a0b91447 100644
--- a/juick-core/src/main/java/com/juick/server/SubscriptionsQueries.java
+++ b/juick-core/src/main/java/com/juick/server/SubscriptionsQueries.java
@@ -80,7 +80,7 @@ public class SubscriptionsQueries {
}
public static boolean subscribeUser(JdbcTemplate sql, User user, User toUser) {
return sql.update("INSERT IGNORE INTO subscr_users(user_id,suser_id) VALUES (?,?)",
- user.getUID(), toUser.getUID()) == 1;
+ toUser.getUID(), user.getUID()) == 1;
}
public static boolean unSubscribeUser(JdbcTemplate sql, User user, User fromUser) {
return sql.update("DELETE FROM subscr_users WHERE suser_id=? AND user_id=?",
diff --git a/juick-core/src/main/java/com/juick/server/protocol/JuickProtocol.java b/juick-core/src/main/java/com/juick/server/protocol/JuickProtocol.java
index 1a2e5333..033417a8 100644
--- a/juick-core/src/main/java/com/juick/server/protocol/JuickProtocol.java
+++ b/juick-core/src/main/java/com/juick/server/protocol/JuickProtocol.java
@@ -152,7 +152,7 @@ public class JuickProtocol {
@UserCommand(pattern = "^(#+)$", help = "# - Show last messages from your feed (## - second page, ...)")
public ProtocolReply commandMyFeed(User user, String... arguments) {
// number of # is the page count
- int page = arguments[0].length();
+ int page = arguments[0].length() - 1;
List<Integer> mids = MessagesQueries.getMyFeed(sql, user.getUID(), page);
List<Message> messages = MessagesQueries.getMessages(sql, mids);
// TODO: add instructions for empty feed