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.
		
		
		
		
		
			
		
			
				
	
	
		
			35 lines
		
	
	
		
			911 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			35 lines
		
	
	
		
			911 B
		
	
	
	
		
			TypeScript
		
	
import { EnvelopePlus } from '../../../receiver/types';
 | 
						|
import { SignalService } from '../../../protobuf';
 | 
						|
 | 
						|
import uuid from 'uuid';
 | 
						|
 | 
						|
export function generateEnvelopePlusClosedGroup(groupId: string, sender: string): EnvelopePlus {
 | 
						|
  const envelope: EnvelopePlus = {
 | 
						|
    senderIdentity: sender,
 | 
						|
    receivedAt: Date.now(),
 | 
						|
    timestamp: Date.now() - 2000,
 | 
						|
    id: uuid(),
 | 
						|
    type: SignalService.Envelope.Type.CLOSED_GROUP_MESSAGE,
 | 
						|
    source: groupId,
 | 
						|
    content: new Uint8Array(),
 | 
						|
    toJSON: () => ['fake'],
 | 
						|
  };
 | 
						|
 | 
						|
  return envelope;
 | 
						|
}
 | 
						|
 | 
						|
export function generateEnvelopePlus(sender: string): EnvelopePlus {
 | 
						|
  const envelope: EnvelopePlus = {
 | 
						|
    receivedAt: Date.now(),
 | 
						|
    timestamp: Date.now() - 2000,
 | 
						|
    id: uuid(),
 | 
						|
    type: SignalService.Envelope.Type.SESSION_MESSAGE,
 | 
						|
    source: sender,
 | 
						|
    senderIdentity: sender,
 | 
						|
    content: new Uint8Array(),
 | 
						|
    toJSON: () => ['fake'],
 | 
						|
  };
 | 
						|
 | 
						|
  return envelope;
 | 
						|
}
 |