|  |  | @ -76,7 +76,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |       return { |  |  |  |       return { | 
			
		
	
		
		
			
				
					
					|  |  |  |         unreadCount: 0, |  |  |  |         unreadCount: 0, | 
			
		
	
		
		
			
				
					
					|  |  |  |         verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT, |  |  |  |         verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT, | 
			
		
	
		
		
			
				
					
					|  |  |  |         keysPending: true |  |  |  |         keyExchangeStatus: 'none' | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       }; |  |  |  |       }; | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -398,29 +398,36 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |         return contact.isVerified(); |  |  |  |         return contact.isVerified(); | 
			
		
	
		
		
			
				
					
					|  |  |  |       }); |  |  |  |       }); | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     isKeysPending() { |  |  |  |     getKeyExchangeStatus() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       if (this.isPrivate()) { |  |  |  |       return this.get('keyExchangeStatus') || 'none'; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (this.isMe()) { |  |  |  |     }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           return false; |  |  |  |     isKeyExchangeCompleted() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |       if (!this.isPrivate()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         const keysPending = this.get('keysPending'); |  |  |  |         throw new Error( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (keysPending === undefined) { |  |  |  |           'isKeyExchangeCompleted not implemented for groups' | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           keysPending = true; |  |  |  |         ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         return keysPending; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       throw new Error( |  |  |  |       if (this.isMe()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         'isKeysPending not implemented for groups' |  |  |  |         return true; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |       } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       return this.getKeyExchangeStatus() == 'completed'; | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     setKeysPending(keysPending) { |  |  |  |     setKeyExchangeStatus(status) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       if (typeof keysPending !== 'boolean') { |  |  |  |       if (typeof status !== 'string') { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         throw new Error( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           'setKeyExchangeStatus expects a string' | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       status = status.toLowerCase(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |        | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       if (['none', 'ongoing', 'completed'].indexOf(status) < 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         throw new Error( |  |  |  |         throw new Error( | 
			
		
	
		
		
			
				
					
					|  |  |  |           'setKeysPending expects a boolean' |  |  |  |           'unknown string value given to setKeyExchangeStatus' | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         ); |  |  |  |         ); | 
			
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  |       this.set({ keysPending }); |  |  |  |       this.set({ keyExchangeStatus: status }); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     isUnverified() { |  |  |  |     isUnverified() { | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (this.isPrivate()) { |  |  |  |       if (this.isPrivate()) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |