diff options
| author | erdgeist <> | 2004-02-01 15:37:21 +0000 |
|---|---|---|
| committer | erdgeist <> | 2004-02-01 15:37:21 +0000 |
| commit | 599760ac5c011c9ffc1515264ad08ca7dea98b44 (patch) | |
| tree | b92116102e8ff97f6dc1affee6a5a1e8ecf4e200 | |
| parent | 00c4316e69b9a61a7fe8eb7d06247d491055d10e (diff) | |
Bell on PM // Match username && username:
| -rwxr-xr-x | vchat-commands.c | 2 | ||||
| -rwxr-xr-x | vchat-config.h | 1 | ||||
| -rwxr-xr-x | vchat-protocol.c | 4 | ||||
| -rwxr-xr-x | vchat-ui.c | 4 | ||||
| -rwxr-xr-x | vchat-user.c | 4 | ||||
| -rwxr-xr-x | vchat.h | 4 |
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 */ |
| @@ -324,7 +324,7 @@ int writecf (formtstr id,unsigned char *str) { | |||
| 324 | return i; | 324 | return i; |
| 325 | } | 325 | } |
| 326 | 326 | ||
| 327 | int writepriv (unsigned char *str) { | 327 | int 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) | |||
| 159 | user * | 159 | user * |
| 160 | ul_finduser (unsigned char *name) { | 160 | ul_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 | } |
| @@ -39,7 +39,7 @@ typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT, | |||
| 39 | CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGFILE, | 39 | CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGFILE, |
| 40 | CF_USESSL, CF_USECERT, CF_PRIVHEIGHT, CF_HSCROLL, CF_CHANNEL, CF_USETIME, | 40 | CF_USESSL, CF_USECERT, CF_PRIVHEIGHT, CF_HSCROLL, CF_CHANNEL, CF_USETIME, |
| 41 | CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, | 41 | CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, |
| 42 | CF_KEEPLOG, CF_ENCODING } confopt; | 42 | CF_KEEPLOG, CF_ENCODING, CF_BELLPRIV } confopt; |
| 43 | 43 | ||
| 44 | /* format strings */ | 44 | /* format strings */ |
| 45 | typedef enum { FS_PLAIN, FS_CHAN, FS_PRIV, FS_SERV, FS_GLOB, FS_DBG, FS_ERR, | 45 | typedef 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 */ |
| 151 | int writechan (unsigned char *str); | 151 | int writechan (unsigned char *str); |
| 152 | int writepriv (unsigned char *str); | 152 | int writepriv (unsigned char *str, int maybeep ); |
| 153 | void writeout (unsigned char *str); | 153 | void writeout (unsigned char *str); |
| 154 | void showout (void); | 154 | void showout (void); |
| 155 | void flushout (void); | 155 | void flushout (void); |
