summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2003-08-14 11:28:48 +0000
committererdgeist <>2003-08-14 11:28:48 +0000
commit12a82a3daf3cd010f473d82b2fcd03c99435c58f (patch)
tree54eeef8ba4df8de152dc060b0e6e2d853ef44271
parentb8b51815544c2a0ad7a294b4c901594378dc3b98 (diff)
Public thoughts
-rwxr-xr-xvchat-commands.c16
-rwxr-xr-xvchat-config.h3
-rwxr-xr-xvchat-messages.h3
-rwxr-xr-xvchat-protocol.c21
-rwxr-xr-xvchat.h6
5 files changed, 44 insertions, 5 deletions
diff --git a/vchat-commands.c b/vchat-commands.c
index 6380a44..0d7cf96 100755
--- a/vchat-commands.c
+++ b/vchat-commands.c
@@ -189,7 +189,7 @@ handleline (unsigned char *line)
189 case 'm': /* sending a private message? */ 189 case 'm': /* sending a private message? */
190 privatemessagetx( line+2 ); 190 privatemessagetx( line+2 );
191 break; 191 break;
192 case 'a': 192 case 'a': /* Do an action */
193 doaction( line+2 ); 193 doaction( line+2 );
194 break; 194 break;
195 case '.': 195 case '.':
@@ -206,11 +206,23 @@ handleline (unsigned char *line)
206 showout( ); 206 showout( );
207 } 207 }
208 break; 208 break;
209 case 'o':
210 /* We do think something, the ugly way :) */
211 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_TXPUBTHOUGHT), line);
212 writechan (tmpstr);
213 networkoutput (line);
214 break;
215 case 'O':
216 /* We do think something, the nice way :) */
217 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_TXPUBNTHOUGHT), line);
218 writechan (tmpstr);
219 networkoutput (line);
220 break;
209 default: 221 default:
210 /* generic server command, send to server, show to user */ 222 /* generic server command, send to server, show to user */
211 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_COMMAND), line); 223 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_COMMAND), line);
212 networkoutput (line);
213 writechan (tmpstr); 224 writechan (tmpstr);
225 networkoutput (line);
214 break; 226 break;
215 } 227 }
216 break; 228 break;
diff --git a/vchat-config.h b/vchat-config.h
index 8a680de..beb4579 100755
--- a/vchat-config.h
+++ b/vchat-config.h
@@ -120,6 +120,9 @@ static formatstring formatstrings[] = {
120 FE( FS_BGPRIVMSG, "\0011! Bogus message, not sent."), 120 FE( FS_BGPRIVMSG, "\0011! Bogus message, not sent."),
121 FE( FS_PUBACTION, "\0015*\0010 \0016%s\0010 %s"), 121 FE( FS_PUBACTION, "\0015*\0010 \0016%s\0010 %s"),
122 FE( FS_TXPUBACTION, "\0015*\0010 \0016\001b%s\001B\0010 %s"), 122 FE( FS_TXPUBACTION, "\0015*\0010 \0016\001b%s\001B\0010 %s"),
123 FE( FS_TXPUBTHOUGHT, ".o( \0014%s\0010 )"),
124 FE( FS_TXPUBNTHOUGHT,".oO( \0014%s\0010 )"),
125 FE( FS_PUBTHOUGHT, "\0015*\0010 \0016\001b%s\001B\0010 %s"),
123 FE( FS_BGTXPUBACTION,"\0011! No action taken."), 126 FE( FS_BGTXPUBACTION,"\0011! No action taken."),
124 FE( FS_COMMAND, "\0012## command: %s"), 127 FE( FS_COMMAND, "\0012## command: %s"),
125 FE( FS_LOCALCOMMAND, "\0012## local command (not executed yet): %s"), 128 FE( FS_LOCALCOMMAND, "\0012## local command (not executed yet): %s"),
diff --git a/vchat-messages.h b/vchat-messages.h
index e73e567..477d791 100755
--- a/vchat-messages.h
+++ b/vchat-messages.h
@@ -56,6 +56,9 @@ servermessage servermessages[] = {
56/* 123 <user login [user logout]> 56/* 123 <user login [user logout]>
57 User Login / Logout Information */ 57 User Login / Logout Information */
58 {"123", SM_USERINFO, NULL, NULL}, 58 {"123", SM_USERINFO, NULL, NULL},
59/* 124 <nick> <thoughts>
60 User thoughts information */
61 {"124", SM_CHANNEL, pubthoughts, NULL},
59/* 169 <encoding> 62/* 169 <encoding>
60 List of known encodings */ 63 List of known encodings */
61 {"169", SM_INFO, NULL, NULL}, 64 {"169", SM_INFO, NULL, NULL},
diff --git a/vchat-protocol.c b/vchat-protocol.c
index d04d9b0..5113365 100755
--- a/vchat-protocol.c
+++ b/vchat-protocol.c
@@ -61,6 +61,7 @@ static void login (unsigned char *message);
61static void anonlogin (unsigned char *message); 61static void anonlogin (unsigned char *message);
62static void topicinfo (unsigned char *message); 62static void topicinfo (unsigned char *message);
63static void pubaction (unsigned char *message); 63static void pubaction (unsigned char *message);
64static void pubthoughts (unsigned char *message);
64static void idleprompt (unsigned char *message); 65static void idleprompt (unsigned char *message);
65static void topicchange (unsigned char *message); 66static void topicchange (unsigned char *message);
66static void pmnotsent (unsigned char *message); 67static void pmnotsent (unsigned char *message);
@@ -387,6 +388,26 @@ pubaction (unsigned char *message)
387 writechan (tmpstr); 388 writechan (tmpstr);
388} 389}
389 390
391/* parse and handle an thought string
392 * format: 124 %s %s
393 * vars: %s nick
394 * %s thought */
395static void
396pubthoughts (unsigned char *message)
397{
398 unsigned char *nick = NULL, *thoughts = NULL;
399 nick = strchr (message, ' ');
400 nick[0] = '\0';
401 nick++;
402
403 thoughts = strchr (nick, ' ');
404 thoughts[0] = '\0';
405 thoughts++;
406
407 snprintf(tmpstr,TMPSTRSIZE,getformatstr(FS_PUBTHOUGHT),nick,thoughts);
408 writechan (tmpstr);
409}
410
390/* parse and handle an idle message 411/* parse and handle an idle message
391 * format: 305 412 * format: 305
392 * vars: %s message */ 413 * vars: %s message */
diff --git a/vchat.h b/vchat.h
index b6c4437..64788b9 100755
--- a/vchat.h
+++ b/vchat.h
@@ -47,9 +47,9 @@ FS_IDLE, FS_TIME, FS_CONSOLETIME, FS_TOPICW, FS_NOTOPICW, FS_CONSOLE, FS_CONNECT
47FS_TOPIC, FS_NOTOPIC, FS_CHGTOPIC, FS_USONLINE, FS_USMATCH, FS_SIGNON, FS_SIGNOFF, 47FS_TOPIC, FS_NOTOPIC, FS_CHGTOPIC, FS_USONLINE, FS_USMATCH, FS_SIGNON, FS_SIGNOFF,
48FS_JOIN, FS_LEAVE, FS_NICKCHANGE, FS_UNKNOWNMSG, FS_BOGUSMSG, FS_RXPUBURL, 48FS_JOIN, FS_LEAVE, FS_NICKCHANGE, FS_UNKNOWNMSG, FS_BOGUSMSG, FS_RXPUBURL,
49FS_MYPUBURL, FS_RXPUBMSG, FS_MYPUBMSG, FS_TXPUBMSG, FS_RXPRIVMSG, FS_TXPRIVMSG, 49FS_MYPUBURL, FS_RXPUBMSG, FS_MYPUBMSG, FS_TXPUBMSG, FS_RXPRIVMSG, FS_TXPRIVMSG,
50FS_BGPRIVMSG, FS_PUBACTION, FS_TXPUBACTION, FS_BGTXPUBACTION, FS_COMMAND, 50FS_BGPRIVMSG, FS_PUBTHOUGHT, FS_TXPUBTHOUGHT, FS_TXPUBNTHOUGHT, FS_PUBACTION,
51FS_LOCALCOMMAND, FS_BOGUSCOMMAND, FS_SBINF, FS_MISSTYPED, FS_UNKNCMD, FS_BADREGEX, 51FS_TXPUBACTION, FS_BGTXPUBACTION, FS_COMMAND, FS_LOCALCOMMAND, FS_BOGUSCOMMAND,
52FS_ERR_STRING } formtstr; 52FS_SBINF, FS_MISSTYPED, FS_UNKNCMD, FS_BADREGEX, FS_ERR_STRING } formtstr;
53 53
54/* configoption structure */ 54/* configoption structure */
55struct configoption 55struct configoption