Skip to content

Commit

Permalink
feat(mls): add getMLSSelfConversationGroupId to ConversationDao
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenani committed Oct 18, 2023
1 parent c82d8aa commit 3945b26
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ SELECT changes();
selfConversationId:
SELECT qualified_id FROM Conversation WHERE type = 'SELF' AND protocol = ? LIMIT 1;

selfMLSGroupId:
SELECT mls_group_id FROM Conversation WHERE type = 'SELF' AND protocol = 'MLS' LIMIT 1;

updateConversationReceiptMode:
UPDATE Conversation
SET receipt_mode = ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data class ProposalTimerEntity(

interface ConversationDAO {
suspend fun getSelfConversationId(protocol: ConversationEntity.Protocol): QualifiedIDEntity?
suspend fun getMLSSelfConversationGroupId(): String?
suspend fun insertConversation(conversationEntity: ConversationEntity)
suspend fun insertConversations(conversationEntities: List<ConversationEntity>)
suspend fun updateConversation(conversationEntity: ConversationEntity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ internal class ConversationDAOImpl internal constructor(
conversationQueries.selfConversationId(protocol).executeAsOneOrNull()
}

override suspend fun getMLSSelfConversationGroupId(): String? = withContext(coroutineContext) {
conversationQueries.selfMLSGroupId().executeAsOneOrNull()?.mls_group_id
}

override suspend fun insertConversation(conversationEntity: ConversationEntity) = withContext(coroutineContext) {
nonSuspendingInsertConversation(conversationEntity)
}
Expand Down

0 comments on commit 3945b26

Please sign in to comment.