mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Android UI for blogs (restricted groups).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user