mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Fix closed group messaging from slave devices
This commit is contained in:
parent
25fd92fa79
commit
92b4b81935
@ -22,11 +22,15 @@ import java.util.*
|
|||||||
|
|
||||||
object ClosedGroupsProtocol {
|
object ClosedGroupsProtocol {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Blocks the calling thread.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun shouldIgnoreContentMessage(context: Context, conversation: Recipient, groupID: String?, content: SignalServiceContent): Boolean {
|
fun shouldIgnoreContentMessage(context: Context, conversation: Recipient, groupID: String?, content: SignalServiceContent): Boolean {
|
||||||
if (!conversation.address.isClosedGroup || groupID == null) { return false }
|
if (!conversation.address.isClosedGroup || groupID == null) { return false }
|
||||||
// A closed group's members should never include slave devices
|
// A closed group's members should never include slave devices
|
||||||
val senderPublicKey = content.sender
|
val senderPublicKey = content.sender
|
||||||
|
LokiFileServerAPI.shared.getDeviceLinks(senderPublicKey).get()
|
||||||
val senderMasterPublicKey = MultiDeviceProtocol.shared.getMasterDevice(senderPublicKey)
|
val senderMasterPublicKey = MultiDeviceProtocol.shared.getMasterDevice(senderPublicKey)
|
||||||
val publicKeyToCheckFor = senderMasterPublicKey ?: senderPublicKey
|
val publicKeyToCheckFor = senderMasterPublicKey ?: senderPublicKey
|
||||||
val members = DatabaseFactory.getGroupDatabase(context).getGroupMembers(groupID, true)
|
val members = DatabaseFactory.getGroupDatabase(context).getGroupMembers(groupID, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user