Android UI for blogs (restricted groups).

This commit is contained in:
akwizgran
2013-03-23 14:30:59 +00:00
parent d5879df6eb
commit 4e5366509d
24 changed files with 168 additions and 65 deletions

View File

@@ -327,5 +327,5 @@ public interface DatabaseComponent {
* Unsubscribes from the given group. Any messages belonging to the group
* are deleted from the database.
*/
void unsubscribe(GroupId g) throws DbException;
void unsubscribe(Group g) throws DbException;
}

View File

@@ -1,20 +1,20 @@
package net.sf.briar.api.db.event;
import net.sf.briar.api.messaging.GroupId;
import net.sf.briar.api.messaging.Group;
/** An event that is broadcast when a group message is added to the database. */
public class GroupMessageAddedEvent extends DatabaseEvent {
private final GroupId groupId;
private final Group group;
private final boolean incoming;
public GroupMessageAddedEvent(GroupId groupId, boolean incoming) {
this.groupId = groupId;
public GroupMessageAddedEvent(Group group, boolean incoming) {
this.group = group;
this.incoming = incoming;
}
public GroupId getGroupId() {
return groupId;
public Group getGroup() {
return group;
}
public boolean isIncoming() {

View File

@@ -1,17 +1,17 @@
package net.sf.briar.api.db.event;
import net.sf.briar.api.messaging.GroupId;
import net.sf.briar.api.messaging.Group;
/** An event that is broadcast when the user unsubscribes from a group. */
public class SubscriptionRemovedEvent extends DatabaseEvent {
private final GroupId groupId;
private final Group group;
public SubscriptionRemovedEvent(GroupId groupId) {
this.groupId = groupId;
public SubscriptionRemovedEvent(Group group) {
this.group = group;
}
public GroupId getGroupId() {
return groupId;
public Group getGroup() {
return group;
}
}

View File

@@ -23,6 +23,11 @@ public class Group {
return name;
}
/** Returns true if the group is restricted. */
public boolean isRestricted() {
return publicKey != null;
}
/**
* If the group is restricted, returns the public key that is used to
* authorise all messages sent to the group. Otherwise returns null.