mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 03:46:16 +00:00
feat: notify updates for closed group info polling to set recipient name
This commit is contained in:
@@ -478,7 +478,7 @@ open class Storage(
|
||||
return configFactory.user?.getCommunityMessageRequests() == true
|
||||
}
|
||||
|
||||
fun notifyUpdates(forConfigObject: ConfigBase) {
|
||||
private fun notifyUpdates(forConfigObject: ConfigBase) {
|
||||
when (forConfigObject) {
|
||||
is UserProfile -> updateUser(forConfigObject)
|
||||
is Contacts -> updateContacts(forConfigObject)
|
||||
@@ -525,6 +525,9 @@ open class Storage(
|
||||
|
||||
private fun updateGroupInfo(groupInfoConfig: GroupInfoConfig) {
|
||||
val threadId = getOrCreateThreadIdFor(Address.fromSerialized(groupInfoConfig.id().hexString()))
|
||||
val recipient = getRecipientForThread(threadId) ?: return
|
||||
val db = DatabaseComponent.get(context).recipientDatabase()
|
||||
db.setProfileName(recipient, groupInfoConfig.getName())
|
||||
// TODO: handle deleted group, handle delete attachment / message before a certain time
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@ import org.session.libsession.messaging.sending_receiving.pollers.ClosedGroupPol
|
||||
import org.session.libsignal.utilities.SessionId
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class PollerFactory(private val scope: CoroutineScope, private val configFactory: ConfigFactory) {
|
||||
class PollerFactory(private val scope: CoroutineScope,
|
||||
private val configFactory: ConfigFactory) {
|
||||
|
||||
private val pollers = ConcurrentHashMap<SessionId, ClosedGroupPoller>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user