- recipients.add(m.getPushAddress(recipient));
- } catch (InvalidNumberException e) {
- System.err.println("Failed to add recipient \"" + recipient + "\": " + e.getMessage());
+ GroupInfo g = m.getGroupInfo(Base64.decode(ns.getString("group")));
+ if (g == null) {
+ System.err.println("Failed to send to grup \"" + ns.getString("group") + "\": Unknown group");
+ System.err.println("Aborting sending.");
+ System.exit(1);
+ }
+ group = new TextSecureGroup(g.groupId);
+ recipients = g.members;
+ } catch (IOException e) {
+ System.err.println("Failed to send to grup \"" + ns.getString("group") + "\": " + e.getMessage());