summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-24 12:22:05 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-24 12:22:05 +0800
commite49b495b8551d74dc4d976e15beacca446413672 (patch)
treeca45e30b830f75f4f8ebfe0feb319cedc6477d3b
parent3f50fed1ff50307ba55dc07f8826a019f41d0f68 (diff)
downloadpttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar.gz
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar.bz2
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar.lz
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar.xz
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.tar.zst
pttbbs-e49b495b8551d74dc4d976e15beacca446413672.zip
* for non-ascii nicks, highlight all.
* add EXP_CCW_MOTD for bug reports stuff. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4975 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/ccw.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/ccw.c b/pttbbs/mbbsd/ccw.c
index 2147db36..03ad8dda 100644
--- a/pttbbs/mbbsd/ccw.c
+++ b/pttbbs/mbbsd/ccw.c
@@ -38,6 +38,9 @@
// 6. add F1 for help?
// 7. better receive/send buffer
+///////////////////////////////////////////////////////////////////////////
+// Constant values
+
#define CCW_MAX_INPUT_LEN (STRLEN)
#define CCW_INIT_LINE (2)
#define CCW_STOP_LINE (t_lines-3)
@@ -211,6 +214,8 @@ ccw_peek_cmd(CCW_CTX *ctx, const char *buf, int local)
static void
ccw_print_line(CCW_CTX *ctx, const char *buf, int local)
{
+ // FIXME if printed message is too long, the 2nd line will be overwritten
+ // by next print_line request.
ccw_prepare_line(ctx);
if (ctx->print_line)
{
@@ -394,6 +399,9 @@ ccw_process(CCW_CTX *ctx)
"กป Powered by piaip's Common Chat Window" ANSI_RESET,
CCW_LOCAL_MSG);
#endif
+#ifdef EXP_CCW_MOTD
+ ccw_print_line(ctx, EXP_CCW_MOTD, CCW_LOCAL_MSG);
+#endif
while (!ctx->abort)
{
@@ -843,7 +851,7 @@ ccw_chat_print_highlights(CCW_CTX *ctx, const char *s)
if (m < 0)
{
n = strlen(ctx->local_id);
- if (n > 2)
+ if (n > 2 || !isascii(ctx->local_id[0]) )
m = word_match_index(s, ctx->local_id, n);
}
@@ -867,7 +875,7 @@ ccw_chat_print_line(CCW_CTX *ctx, const char *buf, int local)
size_t szid;
// let's try harder to recognize the content
- if (local != CCW_REMOTE || buf[0] == ' '||
+ if (local != CCW_REMOTE || buf[0] == ' '||
strchr(buf, ESC_CHR) || !strchr(buf, ':') )
{
// pre-formatted or messages