Archive sessions whenever an identity key changes
Sessions established with the previous identity should no longer be used for sending, so we should close them. Since we've added this call to saveIdentity, we can omit the call to it after profile fetches. // FREEBIE
This commit is contained in:
		
					parent
					
						
							
								0056cbefc1
							
						
					
				
			
			
				commit
				
					
						d7054f4b63
					
				
			
		
					 2 changed files with 4 additions and 6 deletions
				
			
		| 
						 | 
					@ -569,11 +569,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return textsecure.storage.protocol.saveIdentity(
 | 
					            return textsecure.storage.protocol.saveIdentity(
 | 
				
			||||||
                id, identityKey, false
 | 
					                id, identityKey, false
 | 
				
			||||||
            ).then(function(isIdentityChange) {
 | 
					            );
 | 
				
			||||||
                if (isIdentityChange) {
 | 
					 | 
				
			||||||
                    return textsecure.storage.protocol.archiveAllSessions(id);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -457,7 +457,9 @@
 | 
				
			||||||
                            nonblockingApproval : nonblockingApproval,
 | 
					                            nonblockingApproval : nonblockingApproval,
 | 
				
			||||||
                        }).then(function() {
 | 
					                        }).then(function() {
 | 
				
			||||||
                            this.trigger('keychange', identifier);
 | 
					                            this.trigger('keychange', identifier);
 | 
				
			||||||
                            resolve(true);
 | 
					                            this.archiveAllSessions(identifier).then(function() {
 | 
				
			||||||
 | 
					                                resolve(true);
 | 
				
			||||||
 | 
					                            }, reject);
 | 
				
			||||||
                        }.bind(this));
 | 
					                        }.bind(this));
 | 
				
			||||||
                    } else if (this.isNonBlockingApprovalRequired(identityRecord)) {
 | 
					                    } else if (this.isNonBlockingApprovalRequired(identityRecord)) {
 | 
				
			||||||
                        console.log("Setting approval status...");
 | 
					                        console.log("Setting approval status...");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue