mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-12 16:37:41 +00:00
feat: member counts in v2 open group ConversationActivity
This commit is contained in:
@@ -79,7 +79,7 @@ interface StorageProtocol {
|
||||
|
||||
fun updateTitle(groupID: String, newValue: String)
|
||||
fun updateProfilePicture(groupID: String, newValue: ByteArray)
|
||||
fun setUserCount(room: String, server: String, newValue: Long)
|
||||
fun setUserCount(room: String, server: String, newValue: Int)
|
||||
|
||||
// Last Message Server ID
|
||||
fun getLastMessageServerId(room: String, server: String): Long?
|
||||
|
@@ -482,10 +482,10 @@ object OpenGroupAPIV2 {
|
||||
}
|
||||
}
|
||||
|
||||
fun getMemberCount(room: String, server: String): Promise<Long, Exception> {
|
||||
fun getMemberCount(room: String, server: String): Promise<Int, Exception> {
|
||||
val request = Request(verb = GET, room = room, server = server, endpoint = "member_count")
|
||||
return send(request).map { json ->
|
||||
val memberCount = json["member_count"] as? Long ?: throw Error.PARSING_FAILED
|
||||
val memberCount = json["member_count"] as? Int ?: throw Error.PARSING_FAILED
|
||||
val storage = MessagingModuleConfiguration.shared.storage
|
||||
storage.setUserCount(room, server, memberCount)
|
||||
memberCount
|
||||
|
Reference in New Issue
Block a user