Skip to content

Commit

Permalink
fix: add non-qualified field for compatibility with other clients (#3003
Browse files Browse the repository at this point in the history
)
  • Loading branch information
typfel authored Sep 12, 2024
1 parent 2b6e0ac commit 7f991e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class EventGenerator(private val selfUserID: UserId, targetClient: QualifiedClie
return EventContentDTO.Conversation.NewMessageDTO(
qualifiedConversation = conversationId.toApi(),
qualifiedFrom = from.toApi(),
conversation = conversationId.toPlainID().value,
from = from.toPlainID().value,
time = Clock.System.now(),
data = data
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class EventRepositoryTest {
@Test
fun givenPendingEvents_whenGettingPendingEvents_thenReturnPendingFirstFollowedByComplete() = runTest {
val pendingEventPayload = EventContentDTO.Conversation.NewMessageDTO(
TestConversation.NETWORK_ID,
UserId("value", "domain"),
Instant.UNIX_FIRST_DATE,
MessageEventData("text", "senderId", "recipient")
qualifiedConversation = TestConversation.NETWORK_ID,
qualifiedFrom = UserId("value", "domain"),
time = Instant.UNIX_FIRST_DATE,
data = MessageEventData("text", "senderId", "recipient")
)
val pendingEvent = EventResponse("pendingEventId", listOf(pendingEventPayload))
val notificationsPageResponse = NotificationResponse("time", false, listOf(pendingEvent))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ sealed class EventContentDTO {
data class NewMessageDTO(
@SerialName("qualified_conversation") val qualifiedConversation: ConversationId,
@SerialName("qualified_from") val qualifiedFrom: UserId,
@SerialName("conversation") val conversation: String? = null,
@SerialName("time") val time: Instant,
@SerialName("from") val from: String? = null,
@SerialName("data") val data: MessageEventData,
) : Conversation()

Expand Down

0 comments on commit 7f991e6

Please sign in to comment.