summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2004-02-01 15:37:21 +0000
committererdgeist <>2004-02-01 15:37:21 +0000
commit599760ac5c011c9ffc1515264ad08ca7dea98b44 (patch)
treeb92116102e8ff97f6dc1affee6a5a1e8ecf4e200
parent00c4316e69b9a61a7fe8eb7d06247d491055d10e (diff)
Bell on PM // Match username && username:
-rwxr-xr-xvchat-commands.c2
-rwxr-xr-xvchat-config.h1
-rwxr-xr-xvchat-protocol.c4
-rwxr-xr-xvchat-ui.c4
-rwxr-xr-xvchat-user.c4
-rwxr-xr-xvchat.h4
6 files changed, 12 insertions, 7 deletions
diff --git a/vchat-commands.c b/vchat-commands.c
index 7d41c0c..5f54733 100755
--- a/vchat-commands.c
+++ b/vchat-commands.c
@@ -178,7 +178,7 @@ privatemessagetx ( unsigned char *tail ) {
178 178
179 /* show message in private window */ 179 /* show message in private window */
180 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_TXPRIVMSG), tail, mesg); 180 snprintf (tmpstr, TMPSTRSIZE, getformatstr(FS_TXPRIVMSG), tail, mesg);
181 writepriv (tmpstr); 181 writepriv (tmpstr, 0);
182 182
183 /* note we messaged someone */ 183 /* note we messaged someone */
184 ul_msgto(tail); 184 ul_msgto(tail);
diff --git a/vchat-config.h b/vchat-config.h
index c25c3cb..008a940 100755
--- a/vchat-config.h
+++ b/vchat-config.h
@@ -52,6 +52,7 @@ static volatile configoption configoptions[] = {
52 {CF_SCROLLBPRIVT,CO_INT, "privscrollt",(char *) 0, (char *)-1, { NULL } }, 52 {CF_SCROLLBPRIVT,CO_INT, "privscrollt",(char *) 0, (char *)-1, { NULL } },
53 {CF_SCROLLBACKT, CO_INT, "scrolltime", (char *) 86400, (char *)-1, { NULL } }, 53 {CF_SCROLLBACKT, CO_INT, "scrolltime", (char *) 86400, (char *)-1, { NULL } },
54 {CF_KEEPLOG, CO_INT, "keeplog", (char *) 0, (char *)-1, { NULL } }, 54 {CF_KEEPLOG, CO_INT, "keeplog", (char *) 0, (char *)-1, { NULL } },
55 {CF_BELLPRIV, CO_INT, "bellonpm", (char *) 0, (char *)-1, { NULL } },
55 {CF_NIL, CO_NIL, NULL, NULL, NULL, { NULL } }, 56 {CF_NIL, CO_NIL, NULL, NULL, NULL, { NULL } },
56}; 57};
57 58
diff --git a/vchat-protocol.c b/vchat-protocol.c
index 4d1f333..a78d587 100755
--- a/vchat-protocol.c
+++ b/vchat-protocol.c
@@ -385,7 +385,7 @@ pmnotsent (unsigned char *message)
385{ 385{
386 while(*message && *message!=' ') message++; 386 while(*message && *message!=' ') message++;
387 snprintf(tmpstr,TMPSTRSIZE,getformatstr(FS_ERR),message+1); 387 snprintf(tmpstr,TMPSTRSIZE,getformatstr(FS_ERR),message+1);
388 writepriv( tmpstr); 388 writepriv( tmpstr, 0);
389 389
390} 390}
391 391
@@ -935,7 +935,7 @@ parsemsg (unsigned char *message)
935 str2++; 935 str2++;
936 if (str2[0] == ' ') str2++; 936 if (str2[0] == ' ') str2++;
937 snprintf(tmpstr,TMPSTRSIZE,getformatstr(FS_RXPRIVMSG),str1,str2); 937 snprintf(tmpstr,TMPSTRSIZE,getformatstr(FS_RXPRIVMSG),str1,str2);
938 writepriv (tmpstr); 938 writepriv (tmpstr, 1);
939 ul_msgfrom(str1); 939 ul_msgfrom(str1);
940 } 940 }
941 /* message starts with a number? must be a servermessage */ 941 /* message starts with a number? must be a servermessage */
diff --git a/vchat-ui.c b/vchat-ui.c
index 6afbe19..289d5f5 100755
--- a/vchat-ui.c
+++ b/vchat-ui.c
@@ -324,7 +324,7 @@ int writecf (formtstr id,unsigned char *str) {
324 return i; 324 return i;
325} 325}
326 326
327int writepriv (unsigned char *str) { 327int writepriv (unsigned char *str, int maybeep) {
328 int i = 0; 328 int i = 0;
329 if (private) { 329 if (private) {
330 330
@@ -341,6 +341,8 @@ int writepriv (unsigned char *str) {
341 i = writescr(private, tmp); 341 i = writescr(private, tmp);
342 } 342 }
343 if( privwinhidden ) { 343 if( privwinhidden ) {
344 if( maybeep && getintoption( CF_BELLPRIV ))
345 putchar( 7 );
344 privheight_desired = privwinhidden; 346 privheight_desired = privwinhidden;
345 privwinhidden = 0; 347 privwinhidden = 0;
346 resize(0); 348 resize(0);
diff --git a/vchat-user.c b/vchat-user.c
index 4ad9f4f..1e14112 100755
--- a/vchat-user.c
+++ b/vchat-user.c
@@ -159,11 +159,13 @@ ul_join (unsigned char *name, int channel)
159user * 159user *
160ul_finduser (unsigned char *name) { 160ul_finduser (unsigned char *name) {
161 user *tmp = nicks; 161 user *tmp = nicks;
162 snprintf( tmpstr, TMPSTRSIZE, "%s:", name);
163
162 /* search user */ 164 /* search user */
163 while (tmp) 165 while (tmp)
164 { 166 {
165 /* is it this user? */ 167 /* is it this user? */
166 if (!strcmp (name, tmp->nick)) 168 if (!strcmp (name, tmp->nick) || !strcmp(tmpstr, tmp->nick))
167 { 169 {
168 return tmp; 170 return tmp;
169 } 171 }
diff --git a/vchat.h b/vchat.h
index fcae04f..33c378b 100755
--- a/vchat.h
+++ b/vchat.h
@@ -39,7 +39,7 @@ typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT,
39CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGFILE, 39CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGFILE,
40CF_USESSL, CF_USECERT, CF_PRIVHEIGHT, CF_HSCROLL, CF_CHANNEL, CF_USETIME, 40CF_USESSL, CF_USECERT, CF_PRIVHEIGHT, CF_HSCROLL, CF_CHANNEL, CF_USETIME,
41CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, 41CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT,
42CF_KEEPLOG, CF_ENCODING } confopt; 42CF_KEEPLOG, CF_ENCODING, CF_BELLPRIV } confopt;
43 43
44/* format strings */ 44/* format strings */
45typedef enum { FS_PLAIN, FS_CHAN, FS_PRIV, FS_SERV, FS_GLOB, FS_DBG, FS_ERR, 45typedef enum { FS_PLAIN, FS_CHAN, FS_PRIV, FS_SERV, FS_GLOB, FS_DBG, FS_ERR,
@@ -149,7 +149,7 @@ void userinput (void);
149 149
150/* display various messages */ 150/* display various messages */
151int writechan (unsigned char *str); 151int writechan (unsigned char *str);
152int writepriv (unsigned char *str); 152int writepriv (unsigned char *str, int maybeep );
153void writeout (unsigned char *str); 153void writeout (unsigned char *str);
154void showout (void); 154void showout (void);
155void flushout (void); 155void flushout (void);