summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xvchat-commands.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/vchat-commands.c b/vchat-commands.c
index 0d7cf96..e60fa70 100755
--- a/vchat-commands.c
+++ b/vchat-commands.c
@@ -118,6 +118,22 @@ translatecommand( unsigned char **cmd)
118 return result; 118 return result;
119} 119}
120 120
121/* handle thought */
122static void
123dothink( unsigned char *tail, char nice )
124{
125 while( *tail == ' ' ) tail++;
126
127 /* send users message to server */
128 snprintf (tmpstr, TMPSTRSIZE, ".%c %s", nice, tail);
129 networkoutput (tmpstr);
130
131 /* show action in channel window */
132 snprintf (tmpstr, TMPSTRSIZE, nice == 'O' ? getformatstr(FS_TXPUBNTHOUGHT) : getformatstr(FS_TXPUBTHOUGHT), tail);
133 writechan (tmpstr);
134}
135
136
121/* handle action */ 137/* handle action */
122static void 138static void
123doaction( unsigned char *tail ) 139doaction( unsigned char *tail )
@@ -207,16 +223,8 @@ handleline (unsigned char *line)
207 } 223 }
208 break; 224 break;
209 case 'o': 225 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': 226 case 'O':
216 /* We do think something, the nice way :) */ 227 dothink( line + 2, line[1] );
217 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_TXPUBNTHOUGHT), line);
218 writechan (tmpstr);
219 networkoutput (line);
220 break; 228 break;
221 default: 229 default:
222 /* generic server command, send to server, show to user */ 230 /* generic server command, send to server, show to user */