Prevent personal blogs from being removed

This also adds unit tests to prevent regressions like this in the
future.
This commit is contained in:
Torsten Grote
2016-09-28 13:12:20 -03:00
parent 7a0db798d1
commit 1f0b305139
2 changed files with 73 additions and 10 deletions

View File

@@ -259,6 +259,7 @@ class BlogManagerImpl extends BdfIncomingMessageHook implements BlogManager,
Blog b = getBlog(txn, g);
AuthorId authorId = b.getAuthor().getId();
LocalAuthor localAuthor = identityManager.getLocalAuthor(txn);
if (localAuthor.getId().equals(authorId)) return false;
canBeRemoved = !contactManager
.contactExists(txn, authorId, localAuthor.getId());
return canBeRemoved;