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.
		
		
		
		
		
			
		
			
				
	
	
		
			29 lines
		
	
	
		
			966 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			29 lines
		
	
	
		
			966 B
		
	
	
	
		
			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);
 | |
|     // 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;
 | |
|   }
 | |
| }
 |