Address review comments

This commit is contained in:
Torsten Grote
2016-10-28 16:07:17 -02:00
parent c79ce61f6d
commit c0aa255bb6
22 changed files with 226 additions and 132 deletions

View File

@@ -84,6 +84,6 @@ public interface ClientHelper {
throws FormatException, GeneralSecurityException;
void verifySignature(byte[] sig, byte[] publicKey, BdfList signed)
throws InvalidMessageException;
throws FormatException, GeneralSecurityException;
}

View File

@@ -12,19 +12,11 @@ public enum MessageType {
}
public static MessageType valueOf(int value) {
switch (value) {
case 0:
return NEW_MEMBER;
case 1:
return JOIN;
case 2:
return POST;
default:
throw new IllegalArgumentException();
}
for (MessageType m : values()) if (m.value == value) return m;
throw new IllegalArgumentException();
}
public int getInt() {
return value;
}
}
}

View File

@@ -18,8 +18,9 @@ public interface PrivateGroupManager extends MessageTracker {
* Adds a new private group and joins it.
*
* @param group The private group to add
* @param newMemberMsg The creator's message announcing the first new member
* @param joinMsg The first new member's join message
* @param newMemberMsg The creator's message announcing herself as
* first new member
* @param joinMsg The creator's own join message
*/
void addPrivateGroup(PrivateGroup group, GroupMessage newMemberMsg,
GroupMessage joinMsg) throws DbException;
@@ -27,10 +28,11 @@ public interface PrivateGroupManager extends MessageTracker {
/** Removes a dissolved private group. */
void removePrivateGroup(GroupId g) throws DbException;
/** Gets the MessageId of the */
/** Gets the MessageId of your previous message sent to the group */
MessageId getPreviousMsgId(GroupId g) throws DbException;
/** Returns the timestamp of the message with the given ID */
// TODO change to getPreviousMessageHeader()
long getMessageTimestamp(MessageId id) throws DbException;
/** Stores (and sends) a local group message. */