mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +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)
|
void revoke(Transaction txn, ContactId contactId)
|
||||||
throws DbException, FormatException;
|
throws DbException, FormatException;
|
||||||
|
|
||||||
|
void revokeAll(Transaction txn) throws DbException, FormatException;
|
||||||
|
|
||||||
boolean remoteWipeIsSetup(Transaction txn);
|
boolean remoteWipeIsSetup(Transaction txn);
|
||||||
|
|
||||||
List<Author> getWipers(Transaction txn) throws DbException;
|
List<Author> getWipers(Transaction txn) throws DbException;
|
||||||
|
|||||||
@@ -400,9 +400,7 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
|
|||||||
BdfDictionary meta = clientHelper.getGroupMetadataAsDictionary(txn,
|
BdfDictionary meta = clientHelper.getGroupMetadataAsDictionary(txn,
|
||||||
localGroup.getId());
|
localGroup.getId());
|
||||||
return meta.getBoolean(GROUP_KEY_AM_WIPER, false);
|
return meta.getBoolean(GROUP_KEY_AM_WIPER, false);
|
||||||
} catch (DbException e) {
|
} catch (DbException | FormatException e) {
|
||||||
return false;
|
|
||||||
} catch (FormatException e) {
|
|
||||||
return false;
|
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
|
@Override
|
||||||
public Group getContactGroup(Contact c) {
|
public Group getContactGroup(Contact c) {
|
||||||
return contactGroupFactory.createContactGroup(CLIENT_ID,
|
return contactGroupFactory.createContactGroup(CLIENT_ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user