Make Sopranica bookmark deleteable.

Added lines to first check if the bookmark has been deleted, if so skips adding the bookmark.
This commit is contained in:
root21 2022-04-19 14:22:39 -06:00 committed by Stephen Paul Weber
parent 48132e2dbb
commit 5ba4e0db44
No known key found for this signature in database
GPG Key ID: D11C2911CE519CDE
2 changed files with 6 additions and 1 deletions

View File

@ -1843,6 +1843,9 @@ public class XmppConnectionService extends Service {
}
public void deleteBookmark(final Account account, final Bookmark bookmark) {
if (bookmark.getJid().toString().equals("discuss@conference.soprani.ca")) {
getPreferences().edit().putBoolean("cheogram_sopranica_bookmark_deleted", true).apply();
}
account.removeBookmark(bookmark);
final XmppConnection connection = account.getXmppConnection();
if (connection.getFeatures().bookmarks2()) {

View File

@ -986,7 +986,9 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
Collections.sort(this.contacts);
if (!foundSopranica && (needle == null || needle.equals(""))) {
final boolean sopranicaDeleted = getPreferences().getBoolean("cheogram_sopranica_bookmark_deleted", false);
if (!sopranicaDeleted && !foundSopranica && (needle == null || needle.equals(""))) {
Bookmark bookmark = new Bookmark(
xmppConnectionService.getAccounts().get(0),
Jid.of("discuss@conference.soprani.ca")