-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Get and save clients mlsPublicKeys (WPB-2308) (#1932)
* feat: receive and store composite messages [part-1] (#1888) * receive composite messages * map composite to proto * detekt * detekt * db migration * db migration * sqm * map to composite entity * detekt * remove is pending state from the DB * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * address PR comments * detekt * remove composite message preview mapping * fix migration * merge issues * address PR comments * address PR comments * detekt --------- Co-authored-by: Vitor Hugo Schwaab <[email protected]> * feat: use case to send Message Button Action [part-2] (#1896) * receive composite messages * map composite to proto * detekt * detekt * db migration * db migration * sqm * map to composite entity * detekt * remove is pending state from the DB * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * address PR comments * detekt * remove composite message preview mapping * fix migration * feat: use case to execute composite message action * expose use case to message scope * missing param * rename use case * docs * map to proto * merge issues * address PR comments * address PR comments * detekt * sent the message only to the message original sender * detekt * Update logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageMetaDataRepositoryTest.kt Co-authored-by: Alexandre Ferris <[email protected]> * PR comments --------- Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Alexandre Ferris <[email protected]> * feat: handle composite action confermation message [part-3] (#1901) * receive composite messages * map composite to proto * detekt * detekt * db migration * db migration * sqm * map to composite entity * detekt * remove is pending state from the DB * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * address PR comments * detekt * remove composite message preview mapping * fix migration * feat: use case to execute composite message action * expose use case to message scope * missing param * rename use case * docs * map to proto * merge issues * address PR comments * address PR comments * detekt * handle ButtonActionConfirmation event * add unit test * detekt * detekt * sent the message only to the message original sender * detekt --------- Co-authored-by: Vitor Hugo Schwaab <[email protected]> * feat: composite message preview [part-4] (#1908) * receive composite messages * map composite to proto * detekt * detekt * db migration * db migration * sqm * map to composite entity * detekt * remove is pending state from the DB * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * Update logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt Co-authored-by: Vitor Hugo Schwaab <[email protected]> * address PR comments * detekt * remove composite message preview mapping * fix migration * feat: use case to execute composite message action * expose use case to message scope * missing param * rename use case * docs * map to proto * merge issues * address PR comments * address PR comments * detekt * handle ButtonActionConfirmation event * add unit test * detekt * detekt * sent the message only to the message original sender * detekt * feat: map composite messages preview * Update persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageMapper.kt Co-authored-by: Alexandre Ferris <[email protected]> --------- Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Alexandre Ferris <[email protected]> * fix: composite messages are not included in the getLastMessages query [part-5] (#1909) * include composite messages to message preview * detekt * feat: display composite message preview * add test * feat: composit messages backup [part-6] (#1914) * fea: include message buttons into the backup * import buttons * merge issues * unit test * merge issues * ignore Confirmation messages that are not fom the original message sender * test * cleanup * detekt * typo * typo * PR comments * feat: Get and save clients mlsPublicKeys * feat: Get and save clients mlsPublicKeys: code stly * feat: Get and save clients mlsPublicKeys: tests fix * feat: Get and save clients mlsPublicKeys: removed logs --------- Co-authored-by: Mohamad Jaara <[email protected]> Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Alexandre Ferris <[email protected]>
- Loading branch information
1 parent
e0f35c3
commit d2f94d3
Showing
14 changed files
with
94 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -948,6 +948,7 @@ class ConversationRepositoryTest { | |
null, | ||
null, | ||
null, | ||
null, | ||
null | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE Client ADD COLUMN mls_public_keys TEXT AS Map<String, String> DEFAULT NULL; |
38 changes: 38 additions & 0 deletions
38
...istence/src/commonMain/kotlin/com/wire/kalium/persistence/adapter/MLSPublicKeysAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.kalium.persistence.adapter | ||
|
||
import app.cash.sqldelight.ColumnAdapter | ||
|
||
internal object MLSPublicKeysAdapter : ColumnAdapter<Map<String, String>, String> { | ||
override fun decode(databaseValue: String): Map<String, String> = | ||
if (databaseValue.isEmpty()) { | ||
mapOf() | ||
} else { | ||
databaseValue.split(ITEMS_SEPARATOR).associate { | ||
val components = it.split(KEY_VALUE_SEPARATOR) | ||
components.first() to components.last() | ||
} | ||
} | ||
|
||
override fun encode(value: Map<String, String>): String = | ||
value.toList().joinToString(ITEMS_SEPARATOR) { "${it.first}$KEY_VALUE_SEPARATOR${it.second}" } | ||
|
||
private const val ITEMS_SEPARATOR = ";" | ||
private const val KEY_VALUE_SEPARATOR = "," | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters