mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Revoke all wipers method
This commit is contained in:
@@ -53,6 +53,8 @@ public interface RemoteWipeManager extends ConversationManager.ConversationClien
|
||||
void revoke(Transaction txn, ContactId contactId)
|
||||
throws DbException, FormatException;
|
||||
|
||||
void revokeAll(Transaction txn) throws DbException, FormatException;
|
||||
|
||||
boolean remoteWipeIsSetup(Transaction txn);
|
||||
|
||||
List<Author> getWipers(Transaction txn) throws DbException;
|
||||
|
||||
@@ -400,9 +400,7 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
|
||||
BdfDictionary meta = clientHelper.getGroupMetadataAsDictionary(txn,
|
||||
localGroup.getId());
|
||||
return meta.getBoolean(GROUP_KEY_AM_WIPER, false);
|
||||
} catch (DbException e) {
|
||||
return false;
|
||||
} catch (FormatException e) {
|
||||
} catch (DbException | FormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -434,6 +432,21 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
|
||||
}
|
||||
}
|
||||
|
||||
public void revokeAll(Transaction txn) throws DbException, FormatException {
|
||||
List<ContactId> currentWipers = getWiperContactIds(txn);
|
||||
for (ContactId c : currentWipers) {
|
||||
sendRevokeMessage(txn, db.getContact(txn, c));
|
||||
}
|
||||
|
||||
BdfList noWipers = new BdfList();
|
||||
BdfDictionary meta = new BdfDictionary();
|
||||
meta.put(GROUP_KEY_WIPERS, noWipers);
|
||||
|
||||
if (!db.containsGroup(txn, localGroup.getId()))
|
||||
db.addGroup(txn, localGroup);
|
||||
clientHelper.mergeGroupMetadata(txn, localGroup.getId(), meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getContactGroup(Contact c) {
|
||||
return contactGroupFactory.createContactGroup(CLIENT_ID,
|
||||
|
||||
Reference in New Issue
Block a user