aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2019-10-26 17:48:13 +0200
committerChristian Schneppe <christian.schneppe@pix-art.de>2019-10-26 17:48:13 +0200
commit6df9c91b30c01beeb5d3f25d68f599e0dbe4c319 (patch)
treeee22edb2587cae2748db3b93878e392a619a3e91 /src/main/java/de/pixart/messenger/ui
parent5e41a659b7256c46667086cf690c428f7c764a4c (diff)
WIP Bookmarks 2 support
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java11
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java6
2 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java
index 25d0669ed..9e4cdc680 100644
--- a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java
@@ -226,16 +226,17 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
final boolean syncAutoJoin = getBooleanPreference("autojoin", R.bool.autojoin);
final Account account = xmppConnectionService.findAccountByJid(jid);
final Conversation conversation = xmppConnectionService.findOrCreateConversation(account, result.getRoom(), true, true, true);
- if (conversation.getBookmark() != null) {
- if (!conversation.getBookmark().autojoin() && syncAutoJoin) {
+ Bookmark bookmark = conversation.getBookmark();
+ if (bookmark != null) {
+ if (!bookmark.autojoin() && syncAutoJoin) {
conversation.getBookmark().setAutojoin(true);
- xmppConnectionService.pushBookmarks(account);
+ xmppConnectionService.createBookmark(account, bookmark);
}
} else {
- final Bookmark bookmark = new Bookmark(account, conversation.getJid().asBareJid());
+ bookmark = new Bookmark(account, conversation.getJid().asBareJid());
bookmark.setAutojoin(syncAutoJoin);
account.getBookmarks().add(bookmark);
- xmppConnectionService.pushBookmarks(account);
+ xmppConnectionService.createBookmark(account, bookmark);
}
switchToConversation(conversation);
}
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index d94ebfb28..e34dacb2a 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -424,7 +424,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
bookmark.setConversation(conversation);
if (!bookmark.autojoin() && getPreferences().getBoolean("autojoin", getResources().getBoolean(R.bool.autojoin))) {
bookmark.setAutojoin(true);
- xmppConnectionService.pushBookmarks(bookmark.getAccount());
+ xmppConnectionService.createBookmark(bookmark.getAccount(), bookmark);
}
SoftKeyboardUtils.hideSoftKeyboard(this);
switchToConversation(conversation);
@@ -473,7 +473,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
bookmark.setConversation(null);
Account account = bookmark.getAccount();
account.getBookmarks().remove(bookmark);
- xmppConnectionService.pushBookmarks(account);
+ xmppConnectionService.deleteBookmark(account, bookmark);
filter(mSearchEditText.getText().toString());
});
builder.create().show();
@@ -1024,7 +1024,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
bookmark.setNick(nick);
}
account.getBookmarks().add(bookmark);
- xmppConnectionService.pushBookmarks(account);
+ xmppConnectionService.createBookmark(account, bookmark);
final Conversation conversation = xmppConnectionService
.findOrCreateConversation(account, conferenceJid, true, true, true);
bookmark.setConversation(conversation);