[SES-1002] Synced blind requests (#1303)

* feat: update config to use blinded-msg-requests pr

* feat: add block community message requests bool to protos

* feat: add everything needed for recipientDB to have blocked community requests potentially

* feat: add db migrations

* feat: add sending community block flags and preference options

* feat: add parsing block request flag

* fix: open group message requests were broken anyway

* fix: delete all encoded open group inbox ID bs, fix privacy settings using user config as privacy store

* feat: initial creation sets flag, rename to match libsession implementation value

* fix: recipient blinded checks from open group message for blocking community requests on blinded ID version of recipient, use correct (inverted) values from before for checking polling and empty states etc

* fix: pr comments for view model factory context ref, simplified user config object check for category in PrivacySettingsPreferenceFragment

* fix: pr comments

* fix: migrate some dependencies and functionality out of VM into repository to remove content resolver and context dependecy so tests pass again

* refactor: better naming for hidesInputBar and add more tests for expected recipient view states

* fix: use contact information as opposed to active conversations

* fix: PR comments
This commit is contained in:
0x330a
2023-08-28 09:51:48 +10:00
committed by GitHub
parent f6345c86ce
commit 2466d9b4c0
28 changed files with 522 additions and 157 deletions

View File

@@ -95,4 +95,33 @@ Java_network_loki_messenger_libsession_1util_UserProfile_getNtsPriority(JNIEnv *
std::lock_guard lock{util::util_mutex_};
auto profile = ptrToProfile(env, thiz);
return profile->get_nts_priority();
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_network_loki_messenger_libsession_1util_UserProfile_getCommunityMessageRequests(
JNIEnv *env, jobject thiz) {
std::lock_guard lock{util::util_mutex_};
auto profile = ptrToProfile(env, thiz);
auto blinded_msg_requests = profile->get_blinded_msgreqs();
if (blinded_msg_requests.has_value()) {
return *blinded_msg_requests;
}
return true;
}
extern "C"
JNIEXPORT void JNICALL
Java_network_loki_messenger_libsession_1util_UserProfile_setCommunityMessageRequests(
JNIEnv *env, jobject thiz, jboolean blocks) {
std::lock_guard lock{util::util_mutex_};
auto profile = ptrToProfile(env, thiz);
profile->set_blinded_msgreqs(std::optional{(bool)blocks});
}
extern "C"
JNIEXPORT jboolean JNICALL
Java_network_loki_messenger_libsession_1util_UserProfile_isBlockCommunityMessageRequestsSet(
JNIEnv *env, jobject thiz) {
std::lock_guard lock{util::util_mutex_};
auto profile = ptrToProfile(env, thiz);
return profile->get_blinded_msgreqs().has_value();
}

View File

@@ -126,6 +126,9 @@ class UserProfile(pointer: Long) : ConfigBase(pointer) {
external fun setPic(userPic: UserPic)
external fun setNtsPriority(priority: Int)
external fun getNtsPriority(): Int
external fun getCommunityMessageRequests(): Boolean
external fun setCommunityMessageRequests(blocks: Boolean)
external fun isBlockCommunityMessageRequestsSet(): Boolean
}
class ConversationVolatileConfig(pointer: Long): ConfigBase(pointer) {