+ private GroupInfo getGroupForSending(byte[] groupId) throws GroupNotFoundException, NotAGroupMemberException {
+ GroupInfo g = groupStore.getGroup(groupId);
+ if (g == null) {
+ throw new GroupNotFoundException(groupId);
+ }
+ for (String member : g.members) {
+ if (member.equals(this.username)) {
+ return g;
+ }
+ }
+ throw new NotAGroupMemberException(groupId, g.name);
+ }
+