7 public message( roomInfo ri, int count, int cur_pos, citReply r ) {
8 Vector msg = r.listing;
10 String s, from="", time="", room="", node="", rcpt="";
12 s = (String)msg.firstElement();
13 msg.removeElementAt( 0 );
14 from = begin( from, s, "from=" );
15 time = begin( time, s, "time=" );
16 room = begin( room, s, "room=" );
17 node = begin( node, s, "hnod=" );
18 rcpt = begin( rcpt, s, "rcpt=" );
19 } while( (msg.size() > 0) && (!s.equals( "text" )) );
21 time = makeDate( time );
23 blurb = (cur_pos+1) + "/" + count + " " + time + " from " + from;
24 // if( !node.equals( citadel.me.serverInfo.human_name ) )
26 blurb = blurb + " (@"+node+")";
27 if( !rcpt.equals( "" ) )
28 blurb = blurb + " to " + rcpt;
29 if( !room.equals( ri.name) )
30 blurb = blurb + " in " + room;
32 /* this relies on the fact that we've removed
33 the header lines above. probably a messy way
34 to deal with references. */
35 message = r.getData();
38 public String makeDate( String time ) {
41 t = Long.parseLong( time );
42 } catch( NumberFormatException nfe ) {
45 Date d = new Date( t*1000 );
46 return d.toLocaleString();
49 public String begin( String def, String data, String key ) {
50 if( data.indexOf( key ) == 0 )
51 return data.substring( key.length() );
55 public String getBlurb() { return blurb; }
56 public String getText() { return message; }