* currently logged in
*/
public Sone getCurrentSone(ToadletContext toadletContext, boolean create) {
- Set<Sone> localSones = getCore().getLocalSones();
+ Collection<Sone> localSones = getCore().getLocalSones();
if (localSones.size() == 1) {
return localSones.iterator().next();
}
}
/**
- * Returns all {@link Core#isLocalSone(Sone) local Sone}s that are
- * referenced by {@link SonePart}s in the given text (after parsing it using
+ * Returns all {@link Core#getLocalSones() local Sone}s that are referenced
+ * by {@link SonePart}s in the given text (after parsing it using
* {@link SoneTextParser}).
*
* @param text
*/
@Override
public void newPostFound(Post post) {
- boolean isLocal = getCore().isLocalSone(post.getSone());
- if (isLocal) {
+ if (post.getSone().isLocal()) {
localPostNotification.add(post);
} else {
newPostNotification.add(post);
}
if (!hasFirstStartNotification()) {
- notificationManager.addNotification(isLocal ? localPostNotification : newPostNotification);
- if (!getMentionedSones(post.getText()).isEmpty() && !isLocal) {
+ notificationManager.addNotification(post.getSone().isLocal() ? localPostNotification : newPostNotification);
+ if (!getMentionedSones(post.getText()).isEmpty() && !post.getSone().isLocal()) {
mentionNotification.add(post);
notificationManager.addNotification(mentionNotification);
}
*/
@Override
public void newReplyFound(PostReply reply) {
- boolean isLocal = getCore().isLocalSone(reply.getSone());
- if (isLocal) {
+ if (reply.getSone().isLocal()) {
localReplyNotification.add(reply);
} else {
newReplyNotification.add(reply);
}
if (!hasFirstStartNotification()) {
- notificationManager.addNotification(isLocal ? localReplyNotification : newReplyNotification);
- if (!getMentionedSones(reply.getText()).isEmpty() && !isLocal && (reply.getPost().getSone() != null) && (reply.getTime() <= System.currentTimeMillis())) {
+ notificationManager.addNotification(reply.getSone().isLocal() ? localReplyNotification : newReplyNotification);
+ if (!getMentionedSones(reply.getText()).isEmpty() && !reply.getSone().isLocal() && (reply.getPost().getSone() != null) && (reply.getTime() <= System.currentTimeMillis())) {
mentionNotification.add(reply.getPost());
notificationManager.addNotification(mentionNotification);
}