Update of /cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23426/src/freenet/node
Modified Files:
Version.java TextModeClientInterface.java
Log Message:
138:
More UI changes re chatting.
Index: Version.java
===================================================================
RCS file: /cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node/Version.java,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -w -r1.132 -r1.133
--- Version.java 20 Sep 2005 18:19:04 -0000 1.132
+++ Version.java 20 Sep 2005 18:32:06 -0000 1.133
@@ -20,7 +20,7 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- public static final int buildNumber = 137;
+ public static final int buildNumber = 138;
/** Oldest build of Fred we will talk to */
public static final int lastGoodBuild = 136;
Index: TextModeClientInterface.java
===================================================================
RCS file:
/cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node/TextModeClientInterface.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -r1.24 -r1.25
--- TextModeClientInterface.java 20 Sep 2005 18:19:04 -0000 1.24
+++ TextModeClientInterface.java 20 Sep 2005 18:32:06 -0000 1.25
@@ -40,6 +40,7 @@
final Node n;
final Hashtable streams;
private Writer subscribedDataStream;
+ private String lastSendStreamName;
TextModeClientInterface(Node n) {
this.n = n;
@@ -70,6 +71,7 @@
System.out.println("CONNECT:\n<noderef including an End on a line by
itself> - enter a noderef directly.");
System.out.println("NAME:<new node name> - change the node's name.");
System.out.println("SUBFILE:<filename> - append all data received from
subscriptions to a file, rather than sending it to stdout.");
+ System.out.println("SAY:<text> - send text to the last created/pushed
stream");
System.out.println("STATUS - display some status information on the
node including its reference and connections.");
System.out.println("QUIT - exit the program");
// Read command, and data
@@ -274,6 +276,7 @@
FreenetURI streamKey = key.getURI();
streamKey = streamKey.setDocName(line);
System.out.println("Stream key: "+streamKey);
+ lastSendStreamName = line;
streams.put(line, key);
} else if(line.startsWith("PUSH:")) {
// PUSH:<name>:<text>
@@ -298,6 +301,7 @@
System.out.println("Publishing to "+key);
System.out.println("Data to publish:\n"+content);
n.publish(key, content.getBytes("UTF-8"));
+ lastSendStreamName = name;
}
} else if(uline.startsWith("SUBSCRIBE:")) {
line = line.substring("SUBSCRIBE:".length());
@@ -370,6 +374,18 @@
key = key.substring(0, key.length()-2);
System.out.println("New name: "+key);
n.setName(key);
+ } else if(uline.startsWith("SAY ") || uline.startsWith("SAY:")) {
+ String toSay = line.substring("SAY:".length()).trim();
+ if(lastSendStreamName != null) {
+ ClientPublishStreamKey key = (ClientPublishStreamKey)
streams.get(lastSendStreamName);
+ if(key == null) {
+ System.err.println("Could not find stream called
"+lastSendStreamName);
+ } else {
+ System.out.println("Publishing to "+key);
+ System.out.println("Data to publish:\n"+toSay);
+ n.publish(key, toSay.getBytes("UTF-8"));
+ }
+ }
} else {
}