Merge branch '679-own-personal-blogs-can-be-removed' into 'master'

Prevent personal blogs from being removed

This also adds unit tests to prevent regressions like this in the future.

Closes #679

See merge request !330
This commit is contained in:
akwizgran
2016-09-28 16:22:46 +00:00
2 changed files with 73 additions and 10 deletions

View File

@@ -262,6 +262,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;