Implement UI for dissolving and leaving group

This commit is contained in:
Torsten Grote
2016-10-26 18:43:41 -02:00
parent b0a5a69b81
commit 8dac2d1ca6
7 changed files with 123 additions and 14 deletions

View File

@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import javax.inject.Inject;
import static java.lang.Math.max;
import static java.util.logging.Level.WARNING;
public class GroupControllerImpl extends
@@ -174,4 +175,24 @@ public class GroupControllerImpl extends
return new GroupMessageItem(header, body);
}
@Override
public void isCreator(final PrivateGroup group,
final ResultExceptionHandler<Boolean, DbException> handler) {
runOnDbThread(new Runnable() {
@Override
public void run() {
try {
LocalAuthor author = identityManager.getLocalAuthor();
boolean isCreator =
author.getId().equals(group.getAuthor().getId());
handler.onResult(isCreator);
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
handler.onException(e);
}
}
});
}
}