mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { SettingsKey } from '../../../../data/settings-key';
|
|
import { SignalService } from '../../../../protobuf';
|
|
import { Storage } from '../../../../util/storage';
|
|
import { VisibleMessage, VisibleMessageParams } from './VisibleMessage';
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
export type OpenGroupVisibleMessageParams = Omit<
|
|
VisibleMessageParams,
|
|
'expirationType' | 'expireTimer'
|
|
>;
|
|
|
|
export class OpenGroupVisibleMessage extends VisibleMessage {
|
|
private readonly blocksCommunityMessageRequests: boolean;
|
|
|
|
constructor(params: OpenGroupVisibleMessageParams) {
|
|
super({
|
|
...params,
|
|
expirationType: 'unknown',
|
|
expireTimer: 0,
|
|
});
|
|
// they are the opposite of each others
|
|
this.blocksCommunityMessageRequests = !Storage.get(SettingsKey.hasBlindedMsgRequestsEnabled);
|
|
}
|
|
|
|
public override dataProto(): SignalService.DataMessage {
|
|
const dataMessage = super.dataProto();
|
|
|
|
dataMessage.blocksCommunityMessageRequests = this.blocksCommunityMessageRequests;
|
|
|
|
return dataMessage;
|
|
}
|
|
}
|