diff options
Diffstat (limited to 'pttbbs/mbbsd/talk.c')
-rw-r--r-- | pttbbs/mbbsd/talk.c | 34 |
1 files changed, 22 insertions, 12 deletions
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; |