tweak: only fetch and show 5 reactors for open group reactions

pull/676/head
Ryan Zhao 3 years ago
parent f9c2a2ce99
commit 128ef747b3

@ -369,8 +369,11 @@ public extension Message {
let reactors = rawReaction.reactors
{
let timestampMs: Int64 = Int64(floor((Date().timeIntervalSince1970 * 1000)))
let maxLength: Int = !rawReaction.you || reactors.contains(userPublicKey) ? 5 : 4
let desiredReactorIds: [String] = reactors
.filter { $0 != blindedUserPublicKey }
.prefix(maxLength)
.map{ $0 }
results = results
.appending( // Add the first reaction (with the count)

@ -99,7 +99,7 @@ public enum OpenGroupAPI {
),
queryParameters: [
.updateTypes: UpdateTypes.reaction.rawValue,
.reactors: "20"
.reactors: "5"
]
),
responseType: [Failable<Message>].self

Loading…
Cancel
Save