|  |  | @ -43,9 +43,10 @@ function OutgoingMessage( | 
			
		
	
		
		
			
				
					
					|  |  |  |   this.failoverNumbers = []; |  |  |  |   this.failoverNumbers = []; | 
			
		
	
		
		
			
				
					
					|  |  |  |   this.unidentifiedDeliveries = []; |  |  |  |   this.unidentifiedDeliveries = []; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   const { numberInfo, senderCertificate } = options; |  |  |  |   const { numberInfo, senderCertificate, preKeyBundleType } = options; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   this.numberInfo = numberInfo; |  |  |  |   this.numberInfo = numberInfo; | 
			
		
	
		
		
			
				
					
					|  |  |  |   this.senderCertificate = senderCertificate; |  |  |  |   this.senderCertificate = senderCertificate; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   this.preKeyBundleType = preKeyBundleType || textsecure.protobuf.PreKeyBundleMessage.Type.UNKOWN; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | OutgoingMessage.prototype = { |  |  |  | OutgoingMessage.prototype = { | 
			
		
	
	
		
		
			
				
					|  |  | @ -290,6 +291,12 @@ OutgoingMessage.prototype = { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (this.attachPrekeys) { |  |  |  |         if (this.attachPrekeys) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           // Encrypt them with the fallback
 |  |  |  |           // Encrypt them with the fallback
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           const preKeyBundleMessage = await libloki.getPreKeyBundleForNumber(number); |  |  |  |           const preKeyBundleMessage = await libloki.getPreKeyBundleForNumber(number); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           preKeyBundleMessage.type = this.preKeyBundleType; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           // If we have to use fallback encryption then this must be a friend request
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           if (this.fallBackEncryption) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             preKeyBundleMessage.type = textsecure.protobuf.PreKeyBundleMessage.Type.FRIEND_REQUEST; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           const textBundle = this.convertMessageToText(preKeyBundleMessage); |  |  |  |           const textBundle = this.convertMessageToText(preKeyBundleMessage); | 
			
		
	
		
		
			
				
					
					|  |  |  |           const encryptedBundle = await fallBackEncryption.encrypt(textBundle); |  |  |  |           const encryptedBundle = await fallBackEncryption.encrypt(textBundle); | 
			
		
	
		
		
			
				
					
					|  |  |  |           preKeys = { preKeyBundleMessage: encryptedBundle.body }; |  |  |  |           preKeys = { preKeyBundleMessage: encryptedBundle.body }; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |