Changeset View
Changeset View
Standalone View
Standalone View
lib/shared/messages/change-role-message-spec.js
// @flow | // @flow | ||||
import invariant from 'invariant'; | import invariant from 'invariant'; | ||||
import { | import { | ||||
pushTypes, | pushTypes, | ||||
type CreateMessageInfoParams, | type CreateMessageInfoParams, | ||||
type MessageSpec, | type MessageSpec, | ||||
type RobotextParams, | type RobotextParams, | ||||
} from './message-spec.js'; | } from './message-spec.js'; | ||||
import { joinResult } from './utils.js'; | import { joinResult } from './utils.js'; | ||||
import { messageTypes } from '../../types/message-types-enum.js'; | import { messageTypes } from '../../types/message-types-enum.js'; | ||||
import type { | import type { | ||||
MessageInfo, | MessageInfo, | ||||
ClientDBMessageInfo, | ClientDBMessageInfo, | ||||
} from '../../types/message-types.js'; | } from '../../types/message-types.js'; | ||||
import type { | import { | ||||
ChangeRoleMessageData, | type ChangeRoleMessageData, | ||||
ChangeRoleMessageInfo, | type ChangeRoleMessageInfo, | ||||
RawChangeRoleMessageInfo, | type RawChangeRoleMessageInfo, | ||||
rawChangeRoleMessageInfoValidator, | |||||
} from '../../types/messages/change-role.js'; | } from '../../types/messages/change-role.js'; | ||||
import type { NotifTexts } from '../../types/notif-types.js'; | import type { NotifTexts } from '../../types/notif-types.js'; | ||||
import type { ThreadInfo } from '../../types/thread-types.js'; | import type { ThreadInfo } from '../../types/thread-types.js'; | ||||
import type { RelativeUserInfo } from '../../types/user-types.js'; | import type { RelativeUserInfo } from '../../types/user-types.js'; | ||||
import { | import { | ||||
ET, | ET, | ||||
type EntityText, | type EntityText, | ||||
pluralizeEntityText, | pluralizeEntityText, | ||||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | return joinResult( | ||||
rawMessageInfo.type, | rawMessageInfo.type, | ||||
rawMessageInfo.threadID, | rawMessageInfo.threadID, | ||||
rawMessageInfo.creatorID, | rawMessageInfo.creatorID, | ||||
rawMessageInfo.newRole, | rawMessageInfo.newRole, | ||||
); | ); | ||||
}, | }, | ||||
generatesNotifs: async () => pushTypes.NOTIF, | generatesNotifs: async () => pushTypes.NOTIF, | ||||
validator: rawChangeRoleMessageInfoValidator, | |||||
}); | }); |