+ break;
+ case "receive":
+ if (dBusConn != null) {
+ System.err.println("receive is not yet implementd via dbus");
+ System.exit(1);
+ }
+ if (!m.isRegistered()) {
+ System.err.println("User is not registered.");
+ System.exit(1);
+ }
+ int timeout = 5;
+ if (ns.getInt("timeout") != null) {
+ timeout = ns.getInt("timeout");
+ }
+ boolean returnOnTimeout = true;
+ if (timeout < 0) {
+ returnOnTimeout = false;
+ timeout = 3600;
+ }
+ try {
+ m.receiveMessages(timeout, returnOnTimeout, new ReceiveMessageHandler(m));
+ } catch (IOException e) {
+ System.err.println("Error while receiving messages: " + e.getMessage());
+ System.exit(3);
+ } catch (AssertionError e) {
+ handleAssertionError(e);
+ }
+ break;
+ case "quitGroup":
+ if (dBusConn != null) {
+ System.err.println("quitGroup is not yet implementd via dbus");
+ System.exit(1);
+ }
+ if (!m.isRegistered()) {
+ System.err.println("User is not registered.");
+ System.exit(1);
+ }
+
+ try {
+ m.sendQuitGroupMessage(decodeGroupId(ns.getString("group")));
+ } catch (IOException e) {
+ handleIOException(e);
+ } catch (EncapsulatedExceptions e) {
+ handleEncapsulatedExceptions(e);
+ } catch (AssertionError e) {
+ handleAssertionError(e);
+ } catch (GroupNotFoundException e) {
+ handleGroupNotFoundException(e);
+ }
+
+ break;
+ case "updateGroup":
+ if (dBusConn != null) {
+ System.err.println("updateGroup is not yet implementd via dbus");
+ System.exit(1);
+ }
+ if (!m.isRegistered()) {
+ System.err.println("User is not registered.");
+ System.exit(1);
+ }
+