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.
		
		
		
		
		
			
		
			
	
	
		
			38 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			38 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
| 
											5 years ago
										 | import { DataMessage } from '..'; | ||
|  | import { Constants } from '../../..'; | ||
|  | import { SignalService } from '../../../../protobuf'; | ||
|  | import { MessageParams } from '../Message'; | ||
| 
											6 years ago
										 | 
 | ||
| 
											6 years ago
										 | interface GroupInvitationMessageParams extends MessageParams { | ||
| 
											6 years ago
										 |   serverAddress: string; | ||
|  |   serverName: string; | ||
| 
											5 years ago
										 |   // if there is an expire timer set for the conversation, we need to set it.
 | ||
|  |   // otherwise, it will disable the expire timer on the receiving side.
 | ||
|  |   expireTimer?: number; | ||
| 
											6 years ago
										 | } | ||
|  | 
 | ||
| 
											6 years ago
										 | export class GroupInvitationMessage extends DataMessage { | ||
| 
											6 years ago
										 |   private readonly serverAddress: string; | ||
|  |   private readonly serverName: string; | ||
| 
											5 years ago
										 |   private readonly expireTimer?: number; | ||
| 
											6 years ago
										 | 
 | ||
|  |   constructor(params: GroupInvitationMessageParams) { | ||
| 
											6 years ago
										 |     super({ timestamp: params.timestamp, identifier: params.identifier }); | ||
| 
											6 years ago
										 |     this.serverAddress = params.serverAddress; | ||
|  |     this.serverName = params.serverName; | ||
| 
											5 years ago
										 |     this.expireTimer = params.expireTimer; | ||
| 
											6 years ago
										 |   } | ||
| 
											6 years ago
										 | 
 | ||
| 
											5 years ago
										 |   public dataProto(): SignalService.DataMessage { | ||
| 
											6 years ago
										 |     const groupInvitation = new SignalService.DataMessage.GroupInvitation({ | ||
|  |       serverAddress: this.serverAddress, | ||
|  |       serverName: this.serverName, | ||
|  |     }); | ||
|  | 
 | ||
|  |     return new SignalService.DataMessage({ | ||
|  |       groupInvitation, | ||
| 
											5 years ago
										 |       expireTimer: this.expireTimer, | ||
| 
											6 years ago
										 |     }); | ||
| 
											6 years ago
										 |   } | ||
|  | } |