You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			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: null,
 | 
						|
      expireTimer: null,
 | 
						|
    });
 | 
						|
    // they are the opposite of each others
 | 
						|
    this.blocksCommunityMessageRequests = !Storage.get(SettingsKey.hasBlindedMsgRequestsEnabled);
 | 
						|
  }
 | 
						|
 | 
						|
  public dataProto(): SignalService.DataMessage {
 | 
						|
    const dataMessage = super.dataProto();
 | 
						|
 | 
						|
    dataMessage.blocksCommunityMessageRequests = this.blocksCommunityMessageRequests;
 | 
						|
 | 
						|
    return dataMessage;
 | 
						|
  }
 | 
						|
}
 |