Some work on XDAEMON command.
authorcli
Mon Aug 30 00:20:06 2010 +0200 (2010-08-30)
changeset 3973b21e9f3958
parent 38 fdfc7225f799
child 40 f8894df2d079
Some work on XDAEMON command.
src/org/sonews/daemon/command/XDaemonCommand.java
src/org/sonews/storage/Channel.java
     1.1 --- a/src/org/sonews/daemon/command/XDaemonCommand.java	Sun Aug 29 23:23:15 2010 +0200
     1.2 +++ b/src/org/sonews/daemon/command/XDaemonCommand.java	Mon Aug 30 00:20:06 2010 +0200
     1.3 @@ -127,6 +127,16 @@
     1.4  					group.update();
     1.5  					conn.println("200 group " + commands[2] + " marked as deleted");
     1.6  				}
     1.7 +			} else if(commands.length == 5 && commands[1].equalsIgnoreCase("GROUPFLAG")) {
     1.8 +				Group group = StorageManager.current().getGroup(commands[2]);
     1.9 +				String flagName = commands[4];
    1.10 +				if(commands[3].equalsIgnoreCase("SET")) {
    1.11 +					
    1.12 +				} else if(commands[3].equalsIgnoreCase("UNSET")) {
    1.13 +					
    1.14 +				} else {
    1.15 +					conn.println("500 invalid command usage");
    1.16 +				}
    1.17  			} else if (commands.length == 4 && commands[1].equalsIgnoreCase("SET")) {
    1.18  				String key = commands[2];
    1.19  				String val = commands[3];
    1.20 @@ -194,6 +204,7 @@
    1.21  					conn.println("401 unknown sub command");
    1.22  				}
    1.23  			} else if (commands.length >= 3 && commands[1].equalsIgnoreCase("PLUGIN")) {
    1.24 +				conn.println("400 invalid command usage");
    1.25  			} else {
    1.26  				conn.println("400 invalid command usage");
    1.27  			}
     2.1 --- a/src/org/sonews/storage/Channel.java	Sun Aug 29 23:23:15 2010 +0200
     2.2 +++ b/src/org/sonews/storage/Channel.java	Mon Aug 30 00:20:06 2010 +0200
     2.3 @@ -39,12 +39,14 @@
     2.4  	 * the mailing list gateway.
     2.5  	 */
     2.6  	public static final int MAILINGLIST = 0x1;
     2.7 +
     2.8  	/**
     2.9  	 * If this flag is set the Group is marked as readonly and the posting
    2.10  	 * is prohibited. This can be useful for groups that are synced only in
    2.11  	 * one direction.
    2.12  	 */
    2.13  	public static final int READONLY = 0x2;
    2.14 +
    2.15  	/**
    2.16  	 * If this flag is set the Group is marked as deleted and must not occur
    2.17  	 * in any output. The deletion is done lazily by a low priority daemon.