Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AND-14] Refactor Channel.lastMessageAt logic #5488

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public fun randomChannelVisibleEvent(
channelType: String = randomString(),
channelId: String = randomString(),
user: User = randomUser(),

): ChannelVisibleEvent = ChannelVisibleEvent(
type = EventType.CHANNEL_VISIBLE,
createdAt = createdAt,
Expand All @@ -75,6 +76,7 @@ public fun randomChannelVisibleEvent(
channelType = channelType,
channelId = channelId,
user = user,
channelLastMessageAt = randomDate(),
)

public fun randomUserStartWatchingEvent(
Expand All @@ -93,6 +95,7 @@ public fun randomUserStartWatchingEvent(
channelType = channelType,
channelId = channelId,
user = user,
channelLastMessageAt = randomDate(),
)

public fun randomChannelDeletedEvent(
Expand All @@ -113,6 +116,7 @@ public fun randomChannelDeletedEvent(
channelType = channelType,
channelId = channelId,
channel = channel,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -136,6 +140,7 @@ public fun randomNotificationChannelDeletedEvent(
channel = channel,
totalUnreadCount = totalUnreadCount,
unreadChannels = unreadChannels,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -159,6 +164,7 @@ public fun randomReactionNewEvent(
channelId = channelId,
message = message,
reaction = reaction,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -178,6 +184,7 @@ public fun randomMessageReadEvent(
cid = cid,
channelType = channelType,
channelId = channelId,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -201,6 +208,7 @@ public fun randomNotificationMarkReadEvent(
channelId = channelId,
totalUnreadCount = totalUnreadCount,
unreadChannels = unreadChannels,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -222,6 +230,7 @@ public fun randomTypingStopEvent(
channelType = channelType,
channelId = channelId,
parentId = parentId,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -243,6 +252,7 @@ public fun randomTypingStartEvent(
channelType = channelType,
channelId = channelId,
parentId = parentId,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -264,6 +274,7 @@ public fun randomMemberAddedEvent(
channelType = channelType,
channelId = channelId,
member = member,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -289,6 +300,7 @@ public fun randomNotificationAddedToChannelEvent(
member = member,
totalUnreadCount = totalUnreadCount,
unreadChannels = unreadChannels,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -314,6 +326,7 @@ public fun randomNotificationMessageNewEvent(
message = message,
totalUnreadCount = totalUnreadCount,
unreadChannels = unreadChannels,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -334,6 +347,7 @@ public fun randomMessageUpdateEvent(
channelType = channelType,
channelId = channelId,
message = message,
channelLastMessageAt = randomDate(),
)

public fun randomChannelUpdatedEvent(
Expand All @@ -353,6 +367,7 @@ public fun randomChannelUpdatedEvent(
channelId = channelId,
message = message,
channel = channel,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -375,6 +390,7 @@ public fun randomChannelUpdatedByUserEvent(
message = message,
channel = channel,
user = user,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -401,6 +417,7 @@ public fun randomNewMessageEvent(
watcherCount = watcherCount,
totalUnreadCount = totalUnreadCount,
unreadChannels = unreadChannels,
channelLastMessageAt = randomDate(),
)
}

Expand Down Expand Up @@ -428,6 +445,7 @@ public fun randomNotificationAddedToChannelEvent(
member = member,
totalUnreadCount = randomInt(),
unreadChannels = randomInt(),
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -448,6 +466,7 @@ public fun randomNotificationRemovedFromChannelEvent(
channelId = randomString(),
channel = channel,
member = member,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -468,6 +487,7 @@ public fun randomNotificationMessageNewEvent(
message = randomMessage(),
totalUnreadCount = randomInt(),
unreadChannels = randomInt(),
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -483,6 +503,7 @@ public fun randomMemberAddedEvent(cid: String = randomString()): MemberAddedEven
channelType = randomString(),
channelId = randomString(),
member = randomMember(),
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -498,6 +519,7 @@ public fun randomMemberRemovedEvent(cid: String = randomString(), member: Member
channelType = randomString(),
channelId = randomString(),
member = member,
channelLastMessageAt = randomDate(),
)
}

Expand All @@ -519,5 +541,6 @@ public fun randomChannelUserBannedEvent(
channelId = id,
expiration = banExpires,
shadow = shadow,
channelLastMessageAt = randomDate(),
)
}
Loading
Loading