diff --git a/ts/opengroup/opengroupV2/ApiUtil.ts b/ts/opengroup/opengroupV2/ApiUtil.ts index 789267150..dc35a7074 100644 --- a/ts/opengroup/opengroupV2/ApiUtil.ts +++ b/ts/opengroup/opengroupV2/ApiUtil.ts @@ -102,7 +102,7 @@ export const parseMessages = async ( } }) ); - return _.compact(messages); + return _.compact(messages).sort((a, b) => (a.serverId || 0) - (b.serverId || 0)); }; // tslint:disable: no-http-string const defaultServerUrl = 'http://116.203.70.33'; diff --git a/ts/opengroup/opengroupV2/OpenGroupAPIV2CompactPoll.ts b/ts/opengroup/opengroupV2/OpenGroupAPIV2CompactPoll.ts index 8a353a6f0..790bed04e 100644 --- a/ts/opengroup/opengroupV2/OpenGroupAPIV2CompactPoll.ts +++ b/ts/opengroup/opengroupV2/OpenGroupAPIV2CompactPoll.ts @@ -331,6 +331,7 @@ const parseCompactPollResult = async ( } const validMessages = await parseMessages(rawMessages); + const moderators = rawMods.sort() as Array; const deletions = rawDeletions as ParsedDeletions; const statusCode = rawStatusCode as number;