summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-22 20:45:15 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-22 20:45:15 +0800
commit7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109 (patch)
tree3697674f0709432a7dc000b3b0e0eda22541520f
parent3d9e752bc118c8e8974e5522e6e5680ddfd50d88 (diff)
downloadpttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar.gz
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar.bz2
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar.lz
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar.xz
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.tar.zst
pttbbs-7fcc93c85bd2931bc8a5c8ee4d71a8cb48c32109.zip
* allow ccw/talk and traditional talk to exist at the same time
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4954 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/mbbsd.c6
-rw-r--r--pttbbs/mbbsd/talk.c34
2 files changed, 28 insertions, 12 deletions
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index a9687ed2..11091193 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/mbbsd/mbbsd.c
@@ -1049,6 +1049,12 @@ setup_utmp(int mode)
strip_nonebig5((unsigned char *)currutmp->nickname, sizeof(currutmp->nickname));
strip_nonebig5((unsigned char *)currutmp->mind, sizeof(currutmp->mind));
+#ifdef EXP_CCW_TALK
+ // magic number for temporary version validation... check talk.c
+ currutmp->nonuse[1] = 'W';
+ currutmp->nonuse[2] = 'T';
+#endif
+
// resolve fromhost
#if defined(WHERE)
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c
index eb3dbae3..c0d7ada0 100644
--- a/pttbbs/mbbsd/talk.c
+++ b/pttbbs/mbbsd/talk.c
@@ -21,7 +21,7 @@ static char * const withme_str[] = {
#define P_INT 20
#define BOARDFRI 1
-#ifndef EXP_CCW_TALK
+// #ifndef EXP_CCW_TALK
#define TALK_MAXCOL (78)
#define TALK_BUFLEN (TALK_MAXCOL+2)
typedef struct twpic {
@@ -34,7 +34,11 @@ typedef struct talkwin_t {
int sline, eline;
twpic_t *big_picture;
} talkwin_t;
-#endif // EXP_CCW_TALK
+// #else
+// XXX magic value, see mbbsd.c
+#define is_ccw_enabled(uip) \
+ (uip->nonuse[1] == 'W' && uip->nonuse[2] == 'T')
+// #endif // EXP_CCW_TALK
typedef struct pickup_t {
userinfo_t *ui;
@@ -50,9 +54,9 @@ static char * const fcolor[11] = {
ANSI_COLOR(33), ANSI_COLOR(1;33), ANSI_COLOR(1;37), ANSI_COLOR(1;37),
ANSI_COLOR(31), ANSI_COLOR(1;35), ANSI_COLOR(1;36)
};
-#ifndef EXP_CCW_TALK
+// #ifndef EXP_CCW_TALK
static char save_page_requestor[40];
-#endif // EXP_CCW_TALK
+// #endif // EXP_CCW_TALK
static char page_requestor[40];
static userinfo_t *uip;
@@ -1136,7 +1140,7 @@ t_display(void)
return DONOTHING;
}
-#ifndef EXP_CCW_TALK
+// #ifndef EXP_CCW_TALK
static void
do_talk_nextline(talkwin_t * twin)
{
@@ -1552,7 +1556,7 @@ do_talk(int fd)
setutmpmode(XINFO);
redrawwin();
}
-#endif // EXP_CCW_TALK
+// #endif // EXP_CCW_TALK
#define lockreturn(unmode, state) if(lockutmpmode(unmode, state)) return
@@ -1838,10 +1842,10 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
add_io(0, 0);
if (c == 'y') {
-#ifndef EXP_CCW_TALK
+// #ifndef EXP_CCW_TALK
snprintf(save_page_requestor, sizeof(save_page_requestor),
"%s (%s)", uin->userid, uin->nickname);
-#endif // EXP_CCW_TALK
+// #endif // EXP_CCW_TALK
switch (uin->sig) {
case SIG_DARK:
main_dark(msgsock, uin);
@@ -1868,7 +1872,10 @@ my_talk(userinfo_t * uin, int fri_stat, char defact)
#ifndef EXP_CCW_TALK
do_talk(msgsock);
#else
- ccw_talk(msgsock, currutmp->destuid);
+ if (is_ccw_enabled(uin))
+ ccw_talk(msgsock, currutmp->destuid);
+ else
+ do_talk(msgsock);
#endif
setutmpmode(XINFO);
break;
@@ -3345,9 +3352,9 @@ establish_talk_connection(const userinfo_t *uip)
struct sockaddr_in sin;
currutmp->msgcount = 0;
-#ifndef EXP_CCW_TALK
+// #ifndef EXP_CCW_TALK
strlcpy(save_page_requestor, page_requestor, sizeof(save_page_requestor));
-#endif
+// #endif
memset(page_requestor, 0, sizeof(page_requestor));
memset(&sin, 0, sizeof(sin));
sin.sin_family = PF_INET;
@@ -3481,7 +3488,10 @@ talkreply(void)
#ifndef EXP_CCW_TALK
do_talk(a);
#else
- ccw_talk(a, currutmp->destuid);
+ if (is_ccw_enabled(uip))
+ ccw_talk(a, currutmp->destuid);
+ else
+ do_talk(a);
#endif
setutmpmode(XINFO);
break;