Skip to content

Commit

Permalink
WIP - trying to debug a glitch with DatabaseStorageModule
Browse files Browse the repository at this point in the history
Signed-off-by: rapterjet2004 <[email protected]>
  • Loading branch information
rapterjet2004 committed Dec 11, 2023
1 parent 476feed commit 50f7b7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ class ConversationInfoActivity :

override fun onResume() {
super.onResume()

if (databaseStorageModule == null) {
databaseStorageModule = DatabaseStorageModule(conversationUser, conversationToken)
}
Log.d("Julius", "DatabaseModule is $databaseStorageModule")
setUpNotificationSettings(databaseStorageModule!!)
binding.deleteConversationAction.setOnClickListener { showDeleteConversationDialog() }
binding.leaveConversationAction.setOnClickListener { leaveConversation() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package com.nextcloud.talk.data.storage

import android.util.Log
import com.nextcloud.talk.data.storage.model.ArbitraryStorage
import com.nextcloud.talk.data.storage.model.ArbitraryStorageEntity
import io.reactivex.Maybe
Expand All @@ -33,7 +34,11 @@ class ArbitraryStoragesRepositoryImpl(private val arbitraryStoragesDao: Arbitrar
): Maybe<ArbitraryStorage> {
return arbitraryStoragesDao
.getStorageSetting(accountIdentifier, key, objectString)
.map { ArbitraryStorageMapper.toModel(it) }
.map {
// TODO debug why changing one conversations storage settings overrides another???
Log.d("Julius", "Arbitary Storage is $it")
ArbitraryStorageMapper.toModel(it)
}
}

override fun getAll(): Maybe<List<ArbitraryStorageEntity>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,13 @@ public boolean getBoolean(String key, boolean defaultVal) {
if ("lobby_switch".equals(key)) {
return lobbyValue;
} else {
return arbitraryStorageManager
boolean result = arbitraryStorageManager
.getStorageSetting(accountIdentifier, key, conversationToken)
.map(arbitraryStorage -> Boolean.parseBoolean(arbitraryStorage.getValue()))
.map(arbitraryStorage -> {
return Boolean.parseBoolean(arbitraryStorage.getValue());
})
.blockingGet(defaultVal);
return result;
}
}

Expand Down Expand Up @@ -251,4 +254,10 @@ public String getString(String key, String defaultVal) {
public void setMessageExpiration(int messageExpiration) {
this.messageExpiration = messageExpiration;
}

@androidx.annotation.NonNull
public String toString() {
return "Conversation token: " + conversationToken
+ "\nAccount Number: " + accountIdentifier;
}
}

0 comments on commit 50f7b7d

Please sign in to comment.