Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/creators/message-creator.js
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
import { earliestFocusedTimeConsideredExpired } from '../shared/focused-times.js'; | import { earliestFocusedTimeConsideredExpired } from '../shared/focused-times.js'; | ||||
import { publisher } from '../socket/redis.js'; | import { publisher } from '../socket/redis.js'; | ||||
import { creationString } from '../utils/idempotent.js'; | import { creationString } from '../utils/idempotent.js'; | ||||
type UserThreadInfo = { | type UserThreadInfo = { | ||||
+devices: Map< | +devices: Map< | ||||
string, | string, | ||||
{ | { | ||||
+deviceType: string, | +platform: string, | ||||
+deviceToken: string, | +deviceToken: string, | ||||
+codeVersion: ?string, | +codeVersion: ?string, | ||||
}, | }, | ||||
>, | >, | ||||
+threadIDs: Set<string>, | +threadIDs: Set<string>, | ||||
+notFocusedThreadIDs: Set<string>, | +notFocusedThreadIDs: Set<string>, | ||||
+userNotMemberOfSubthreads: Set<string>, | +userNotMemberOfSubthreads: Set<string>, | ||||
+subthreadsCanSetToUnread: Set<string>, | +subthreadsCanSetToUnread: Set<string>, | ||||
▲ Show 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | if (!thisUserInfo) { | ||||
!permissionLookup(subthreadPermissions, threadPermissions.VISIBLE) | !permissionLookup(subthreadPermissions, threadPermissions.VISIBLE) | ||||
) { | ) { | ||||
thisUserInfo.userNotMemberOfSubthreads.add(subthread); | thisUserInfo.userNotMemberOfSubthreads.add(subthread); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (deviceToken) { | if (deviceToken) { | ||||
thisUserInfo.devices.set(deviceToken, { | thisUserInfo.devices.set(deviceToken, { | ||||
deviceType: platform, | platform, | ||||
deviceToken, | deviceToken, | ||||
codeVersion: versions ? versions.codeVersion : null, | codeVersion: versions ? versions.codeVersion : null, | ||||
}); | }); | ||||
} | } | ||||
thisUserInfo.threadIDs.add(threadID); | thisUserInfo.threadIDs.add(threadID); | ||||
if (!focusedUser) { | if (!focusedUser) { | ||||
thisUserInfo.notFocusedThreadIDs.add(threadID); | thisUserInfo.notFocusedThreadIDs.add(threadID); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 285 Lines • Show Last 20 Lines |