download chat.cpp
Language: C++
Copyright: Copyright 1987-96, Bit Bucket Software Co.
LOC: 536
Project Info
BinkleyTerm XE(btxe)
Server: SourceForge
Type: cvs
...e\b\btxe\btxe\btnt\sources\
   Addr.cpp
   Addr.h
   aglcrc.cpp
   aglcrc.h
   asyn_lnx.cpp
   asyn_os2.cpp
   asyn_w32.cpp
   async.h
   asyos2v1.h
   b_banner.cpp
   b_bbs.cpp
   b_faxrcv.cpp
   b_flofil.cpp
   b_frproc.cpp
   b_help.cpp
   b_initva.cpp
   b_logs.cpp
   b_passwo.cpp
   b_proto.cpp
   b_rspfil.cpp
   b_sbinit.cpp
   b_script.cpp
   b_search.cpp
   b_sessio.cpp
   b_spawn.cpp
   b_term.cpp
   b_termov.cpp
   b_today.cpp
   b_wazoo.cpp
   b_whack.cpp
   b_wzsend.cpp
   banner.cpp
   banner.h
   BasicString.h
   bbs_ctra.cpp
   bbs_data.cpp
   bbs_incl.h
   bbs_io.cpp
   bink.h
   bink_asm.cpp
   binkdlg.cpp
   binkpipe.h
   box.h
   brec.cpp
   bsend.cpp
   bt.cpp
   btconfig.cpp
   btutil.cpp
   buffer.h
   cache.cpp
   cache.h
   callback.cpp
   callerid.cpp
   callwin.cpp
   callwin.h
   capi.cpp
   cfosline.cpp
   chat.cpp
   com.h
   com_dos.h
   com_lnx.h
   com_os2.h
   com_w32.h
   common.cpp
   cpuload.cpp
   css.cpp
   css.h
   data.cpp
   debug.cpp
   debug.h
   defines.h
   dosfuncs.cpp
   emsi.cpp
   emxmxcom.cpp
   evtparse.cpp
   evtsetup.cpp
   exceptio.cpp
   exceptio.h
   Exceptions.cpp
   Exceptions.h
   externs.h
   faxproto.h
   fcfgread.cpp
   fidomail.h
   file_all.cpp
   file_dos.cpp
   file_io.h
   file_lnx.cpp
   file_os2.cpp
   file_w32.cpp
   foffsets.h
   fossil.cpp
   freepoll.cpp
   ftsc.cpp
   gethcomm.h
   heap.cpp
   history.cpp
   history.h
   hydra.cpp
   hydra.h
   includes.cpp
   includes.h
   janus.cpp
   janus.h
   keybd.h
   keyfncs.h
   keymap.cpp
   langload.cpp
   language.h
   lngmagic.h
   m7rec.cpp
   m7send.cpp
   mailer.cpp
   mailovly.cpp
   mailroot.cpp
   maxcomm.h
   maxmcp.cpp
   maxmcp.h
   maxprm.cpp
   mdm_proc.cpp
   misc.cpp
   msgs.h
   Node.cpp
   Node.h
   NodeList.cpp
   NodeList.h
   nodeproc.cpp
   os2_pm.cpp
   outbound.cpp
   pipe.cpp
   pktmsgs.cpp
   pktmsgs.h
   protcomm.cpp
   prototyp.h
   recvbark.cpp
   recvsync.cpp
   sbuf.cpp
   sbuf.h
   sched.cpp
   sched.h
   script2.cpp
   SelfTest.cpp
   SelfTest.h
   sendbark.cpp
   sendsync.cpp
   squish.cpp
   squish.h
   srif.cpp
   statetbl.cpp
   stats.cpp
   stdafx.cpp
   stdafx.h
   timer.cpp
   timer.h
   times.cpp
   types.h
   v7debug.cpp
   version.cpp
   version7.cpp
   version7.h
   vfos_dos.cpp
   vfos_lnx.cpp
   vfos_os2.cpp
   vfos_qnx.cpp
   vfos_w32.cpp
   vfossil.h
   video.h
   vt100.cpp
   vt100.h
   xfer.h
   xmrec.cpp
   xmsend.cpp
   xstring.h
   yoohoo.cpp
   zmodem.cpp
   zmodem.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
/*---------------------------------------------------------------------------*
 *
 *                               BinkleyTerm
 *
 *              (C) Copyright 1987-96, Bit Bucket Software Co.
 *     For license and contact information see /doc/orig_260/license.260.
 *
 *           This version was modified by the BinkleyTerm XE Team.
 *        For contact information see /doc/team.lst and /doc/join.us.
 *  For a complete list of changes see /doc/xe_user.doc and /doc/xe_hist.doc.
 *
 * Filename    : $Source: /cvsroot/btxe/btnt/sources/chat.cpp,v $
 * Revision    : $Revision: 1.1 $
 * Tagname     : $Name:  $
 * Last updated: $Date: 2005/01/01 15:18:12 $
 * State       : $State: Exp $
 *
 * Description : Hydra Chat
 *
 *---------------------------------------------------------------------------*/

/* Include this file before any other includes or defines! */
#include "includes.h"

/****************************************************************************/
/*  local static data                                                       */
/****************************************************************************/
static REGIONP callwinsave;
static REGIONP chatwinl, chatwinr;

static char *chatstart = "\007\007 * Chat mode start\r\n";
static char *chatend = "\007\007\r\n * Chat mode end\r\n";
static char *chattime = "\007\007\r\n * Chat mode timeout\r\n";

char HaveChat_Bell[] = " * Remote has chat facility (bell enabled)\n";
char HaveChat_NoBell[] = " * Remote has chat facility (bell disabled)\n";
char RemoteHasChat[] = " has chat ";

// MR 970329 not used
// char RemoteHasNoChat[] = " has no chat ";

static word chatfill;
static long lasttimer;
static BOOL msgsent = FALSE;
static BOOL chatting = FALSE;

extern REGIONP modemwin;        /* AS 970315 */

char RemInitials[40], LocInitials[40];

/****************************************************************************/
/*  local prototypes                                                        */
/****************************************************************************/

void chatautostart (void);

/****************************************************************************/
/*  functions                                                               */
/****************************************************************************/

#if 0

#ifdef DOS16                    /* MR 961122 changed DOS to DOS16 */
#define CHATBUFSIZE 256
#else
#define CHATBUFSIZE HYDRATXBUFSIZE
#endif

static char buffer1[CHATBUFSIZE], buffer2[CHATBUFSIZE]; /* chat buffers */
static int bufpos = 0;

void
chat_prepare (void)
{
    bufpos = 0;
}

#define CHATDELAY    30         /* how many 10ms units min. delay between packets */

int
chat_putc (int c)
{
    static long flushtimer;
    int ret = 0;

    if (!nohydrachat)
    {
        if (c >= 0)
        {
            if (bufpos > 0 && (c == '\n' || c == ' ')) /* if this is not the 1st char and we */
                flushtimer = timerset (1); /* have a blank/newline, don't wait long */
            else                      /* do not immediately send char, but    */
                flushtimer = timerset (CHATDELAY); /* wait for some others maybe following */
            if (bufpos < CHATBUFSIZE)
            {
                buffer1[bufpos++] = (char) c;
                ret = 0;
            }
            else
                ret = -1;
        }

        if (bufpos && hydra_devfree ()
                && (timeup (flushtimer) || (bufpos > CHATBUFSIZE / 2)))
        {
            strncpy (buffer2, buffer1, bufpos);
            hydra_devsend ("CON", buffer2, bufpos);
            bufpos = 0;
        }
    }
    return ret;
}

void
chat_puts (char *s)
{
    if (!nohydrachat)
        while (*s)
            chat_putc (*s++);
}

#endif /* 0 */

void
chatsendstring (char *s)
{
    hydra_devsend ("CON", (byte *) s, (word) strlen (s));
    sb_puts (chatwinl, s);
}

void
chatautostart (void)
{
    if (autochatopen && chattimer == 0L)
    {
        chat_init ();
        sb_puts (chatwinl, &chatstart[2]);
        css_upd ();
        chattimer = lasttimer = unix_time (NULL) + CHAT_TIMEOUT;
    }
}

int
chatprocess (char *sorig, int islocal)
{
    int isfor = 2;
    char *c, *s, fn[80], line[80], *back;

    back = s = (char *) malloc (strlen (sorig) + 1);

    if (s == NULL)
        return 0;

    strcpy (s, sorig);
    while ((c = strchr (s, '\n')) != NULL)
        strcpy (c, c + 1);
    while ((c = strchr (s, '\r')) != NULL)
        strcpy (c, c + 1);
    while ((c = strchr (s, 7)) != NULL)
        strcpy (c, c + 1);

    if (ChatLogHandle)
        fprintf (ChatLogHandle, "%s>%s\n", islocal ? LocInitials : RemInitials,
                 s);

    if (strstrci (s, "/btloc") == s)
        isfor = 1;
    else if (strstrci (s, "/btrem") == s)
        isfor = 0;

    if (islocal != isfor)         /* Ignore btloc from remote and btrem from local */
    {
        free (s);
        return 0;
    }
    s += 6;

    while (*s == ' ')
        strcpy (s, s + 1);

    if (strstrci (s, "log") == s)
    {
        if (islocal)
        {
            if (!ChatLogDir)
                status_line ("Directory for chat logs not defined, can't log.");
            else if (ChatLogHandle == NULL)
            {
                c = skip_to_word (s + 3);
                if (!*c)
#if defined(OS_2) | defined(_WIN32)
                    sprintf (fn, "%s%s.CHT", ChatLogDir, remote_sysop);
#else
                    sprintf (fn, "%s%s.CHT", ChatLogDir, RemInitials);
#endif
                else
                    sprintf (fn, "%s%s", ChatLogDir, c);

                ChatLogHandle = share_fopen (fn, append_ascii, DENY_WRITE);

                if (ChatLogHandle == NULL)
                    sprintf (line, "Warning: Failed to open chat log file %s", fn);
                else
                    sprintf (line, "\nNow logging to %s\n", fn);

                chatsendstring (line);
            }
            else
            {
                fclose (ChatLogHandle);
                status_line ("Chat log file closed.");
            }
        }
        else
            chatsendstring ("\nLog is only available for the local user.\n");
    }

    status_line (":Received command: %s", s);
    free (back);
    return 0;
}


void
chat_prepare (void)
{
    chatfill = 0;
    chattimer = -1L;
    lasttimer = 0L;
    msgsent = FALSE;
    chatting = FALSE;
    RemCommandBuf[0] = LocCommandBuf[0] = 0; /* CFS 970426 */
}

void
chat_init (void)
{
    short rows, rows_call, rows_chl, rows_chr;
    short chatwinl_size, chatwinr_size; /* AS 960315 */
    char junk[256], *c;

    /* ---------------------------------------------------------------------------- */
    /* Init. initials for chat logging (for example CFS for Carlos Fernandez Sanz) */
    /* ---------------------------------------------------------------------------- */
    LocInitials[0] = RemInitials[0] = 0;

    c = remote_sysop;
    while (c)
    {
        if (!*c)
            break;
        if (*c != ' ')
            sprintf (RemInitials + strlen (RemInitials), "%c", *c);
        c = skip_to_word (c);
    }

    c = sysop;
    while (c)
    {
        if (!*c)
            break;
        if (*c != ' ')
            sprintf (LocInitials + strlen (LocInitials), "%c", *c);
        c = skip_to_word (c);
    }

    if (!nohydrachat && un_attended && !do_chat)
    {
        chatting = TRUE;
        RemCommandBuf[0] = LocCommandBuf[0] = 0; /* CFS 970426 */

        hydra_devsend ("CON", (byte *) chatstart, (word) strlen (chatstart));

        callwinsave = callwin;

        rows = CALLWIN_HIGH;
        if (rows < 21)
            rows_call = 4;
        else
            rows_call = 10;
        rows -= rows_call;
        rows_chl = rows / 2;
        rows_chr = rows - rows_chl;

        sprintf (junk, MSG_TXT (M_CHAT_WINLOCAL), sysop);

        /*
         * AS 970315, check for existing modemwin and calculate the proper size
         * for the two chat windows and the new (reduced in size) callwin.
         */

        if (modemwin)
        {
            chatwinl_size = SB_COLS - (modemwin->sc1 - modemwin->sc0) - 2;
            chatwinr_size = chatwinl_size;
        }
        else
            chatwinl_size = chatwinr_size = SB_COLS;

        chatwinl = sb_new_win (TOP_PARTS_ROWS, 0,
                               rows_chl, (short) chatwinl_size,
                               ' ', colors.call, boxtype, colors.frames, junk);

        chatwinl->wflags = 0;
        chatwinl->wflags |= SB_SCROLL | SB_WRAP | SB_ADDCR | SB_ADDLF;
        /* MR 970512 we ONLY get LFs and must add CRs */

        sprintf (junk, MSG_TXT (M_CHAT_WINREMOTE), remote_sysop);

        chatwinr = sb_new_win (TOP_PARTS_ROWS + rows_chl, 0,
                               rows_chr, (short) chatwinr_size,
                               ' ', colors.call, boxtype, colors.frames, junk);

        chatwinr->wflags = 0;
        chatwinr->wflags |= SB_SCROLL | SB_WRAP | SB_ADDCR | SB_ADDLF;
        /* MR 970512 we ONLY get LFs and must add CRs */

        callwin = sb_new_win ((short) (TOP_PARTS_ROWS + rows_chl + rows_chr), 0,
                              rows_call, (short) chatwinl_size,
                              ' ', colors.call,
                              boxtype, colors.frames,
                              MSG_TXT (M_RECENT_ACTIVITY));
        callwin->linesize = callwinsave->linesize;
        callwin->buffer = callwinsave->buffer;
        callwin->endbuff = callwinsave->endbuff;
        callwin->lastline = callwinsave->lastline;
        callwin->lastshown = callwinsave->lastshown;

        sb_box (callwin, boxtype, colors.frames);
        sb_caption (callwin, MSG_TXT (M_RECENT_ACTIVITY), colors.frames);
        redraw_callwin ();

        if (modemwin)               /* MR 970327 */
            ctrl_modemwin (1);

        do_chat = 1;
    }
}

void
chat_put_remote (char *s)
{
    char buf[150];
    char *d;
    int i;

    if (!nohydrachat)
    {
        d = s;
        buf[0] = 0;
        // status_line (":Entered with [%s]",s);
        while (*d)
        {
            // sprintf (buf+strlen (buf),"%02X ",*d);
            switch (*d)
            {
            case '\n':
                /* status_line (":Remote sent %s",RemCommandBuf); */
                chatprocess (RemCommandBuf, 0);
                RemCommandBuf[0] = 0;
                break;

            case '\b':
                if (strlen (RemCommandBuf))
                    RemCommandBuf[strlen (LocCommandBuf) - 1] = 0;
                break;

            default:
                RemCommandBuf[strlen (RemCommandBuf) + 1] = 0;
                RemCommandBuf[strlen (RemCommandBuf)] = *d;
                break;
            }

            d++;
        }
        // status_line (":Hex: %s",buf);

        if (chatwinr)
        {
            sb_puts (chatwinr, s);
            css_upd ();
        }
        else
        {
            if (!chatting)
            {
                if (strstr (s, RemoteHasChat)) /* update remote sysop info */
                    show_nodes_name (" (Chat) "); /* in "recent activity"     */
            }

            while (*s)
            {
                strcpy (buf, "*HCON: ");
                i = 0;
                d = buf + 7;
                while (*s && (*s != '\n') && (i < 132))
                {                       /* break up into lines */
                    *d++ = *s++;
                    i++;
                }
                if (*s == '\n')
                    s++;
                *d = '\0';
                status_line (buf);
            }
        }
    }
}

void
chat_exit (void)
{
    chatting = FALSE;
    if (!nohydrachat && un_attended && do_chat)
    {
        hydra_devsend ("CON", (byte *) chatend, (word) strlen (chatend));
        sb_puts (chatwinl, &chatend[2]);
        do_chat = 0;
        callwinsave->linesize = callwin->linesize;
        callwinsave->buffer = callwin->buffer;
        callwinsave->endbuff = callwin->endbuff;
        callwinsave->lastline = callwin->lastline;
        callwinsave->lastshown = callwin->lastshown;

        /* MR 970215 added free; shouldn't we give back allocated memory!? */
        free (callwin);
        free (chatwinr);
        free (chatwinl);

        callwin = callwinsave;
        chatwinr = NULL;
        chatwinl = NULL;

        sb_fill (callwin, ' ', colors.call); /* MR 970307 sb_filla -> sb_fill */
        sb_box (callwin, boxtype, colors.frames);
        sb_caption (callwin, MSG_TXT (M_RECENT_ACTIVITY), colors.frames);
        redraw_callwin ();

        if (modemwin)               /* MR 970327 */
            ctrl_modemwin (1);
    }
}

#if 0
int
chat_get_key (void)
{
    int ret = 0;
    char c;

    while (KEYPRESS ())
    {
        c = READKB ();
        ret = 0;
        if (!do_chat)
        {
            switch (c)
            {
            case 27:
                while (KEYPRESS ())
                    READKB ();
                ret = 27;
                break;

            case '!':
                chat_init ();
                break;
            }
        }
        else
        {                           /* do_chat */
            switch (c)
            {
            case 27:
                chat_exit ();
                break;

            case '\r':
                c = '\n';
                /* fall through into default */

            default:
                sb_putc (chatwinl, c);
                chat_putc (c);
                break;
            }
        }
    }

    chat_putc (-1);               /* if there's something old to send, send it! */
    return ret;
}
#endif

BOOL keyabort (void)
{
#define CHATLEN 256
    static byte chatbuf1[CHATLEN + 5], chatbuf2[CHATLEN + 5], *curbuf =

        chatbuf1;
    static BOOL warned = FALSE;
    BOOL esc = FALSE;
    char *p;
    word c;

    if (chattimer > 0L)
    {
        if (unix_time (NULL) > (unsigned long) chattimer)
        {
            chattimer = lasttimer = 0L;
            hydra_devsend ("CON", (byte *) chattime, (word) strlen (chattime));
            sb_puts (chatwinl, &chattime[2]);
            sb_show ();
            chat_exit ();
        }
        else if ((unix_time (NULL) + 10L) > (unsigned long) chattimer && !warned)
        {
            if (!autochatopen)
                sb_puts (chatwinl,
                         "\007\r\n * Warning: chat mode timeout in 10 seconds\r\n");

            css_upd ();
            warned = TRUE;
        }
    }
    else if (chattimer != lasttimer)
    {
        if (chattimer == 0L && !msgsent)
        {                           /* other side has DEV capacity */
            if (!nohydrachat)
            {
                if (gong_allowed)
                    p = HaveChat_Bell;
                else
                    p = HaveChat_NoBell;
                hydra_devsend ("CON", (byte *) p, (word) strlen (p));
            }
            msgsent = TRUE;
            /* commented out ...
               status_line(" * Hydra session in progress, chat facility now available");
             */
        }
        /* commented out ...
           else if (chattimer == -1L)
           status_line(" * Hydra session in init state, can't chat yet\r\n");
           else if (chattimer == -2L)
           status_line(" * Remote has no chat facility available\r\n");
           else if (chattimer == -3L)
           status_line(" * Hydra session in exit state, can't chat anymore\r\n");
         */
        lasttimer = chattimer;
    }

    /* HJK 20001013 - Fixes bug with NoHydraChat */
    if (nohydrachat || !un_attended) /* fixes nohydrachat */
    {
        while (KEYPRESS ())
        {
#ifndef _WIN32
            c = (word) get_key ();
#else
c = GetKBKey ();
#endif

            if (!CommonProtocolKeyCheck (c))
                switch (c)
                {
                case ESC:
                    esc = TRUE;           /*  exit hydra */
                    break;

                default:
                    esc = FALSE;
                    break;
                }
        }
        return (esc);
    }

    while (KEYPRESS ())
    {
#ifndef _WIN32
        c = (word) get_key ();
#else
        c = GetKBKey ();
#endif

        if (!CommonProtocolKeyCheck (c))
            switch (c)
            {
            case ESC:
                if (chattimer == 0L)
                {                       /* ESC: if in chat mode: exit chat mode */
                    esc = TRUE;           /*  if not in chat mode: exit hydra     */
                }
                else if (chattimer > 0L)
                {
                    chattimer = lasttimer = 0L;
                    chat_exit ();
                }
                else
                    esc = TRUE;
                break;

            case 0x2e00:
                if (chattimer == 0L)
                {
                    chat_init ();
                    sb_puts (chatwinl, &chatstart[2]);
                    css_upd ();
                    chattimer = lasttimer = unix_time (NULL) + CHAT_TIMEOUT;
                }
                else if (chattimer > 0L)
                {
                    chattimer = lasttimer = 0L;
                    chat_exit ();
                }
                else if (!autochatopen)
                    sb_putc (chatwinl, '\007');
                break;

            default:
                if (c < ' ' || c == 127 || c == 255) /*AGL:23apr93 */
                    break;

            case '\r':
            case '\a':
            case '\b':
                if (chattimer <= 0L)
                    break;
                if (c == '\r')
                {
                    /* status_line ("#Got this line: %s",LocCommandBuf); */
                    chatprocess (LocCommandBuf, 1);
                    LocCommandBuf[0] = 0;
                }

                chattimer = unix_time (NULL) + CHAT_TIMEOUT;
                warned = FALSE;

                if (chatfill >= CHATLEN)
                    sb_putc (chatwinl, '\007');
                else
                {
                    switch (c)
                    {
                    case '\r':
                        curbuf[chatfill++] = '\n';
                        sb_putc (chatwinl, '\n');
                        break;

                    case '\b':
                        if (strlen (LocCommandBuf))
                            LocCommandBuf[strlen (LocCommandBuf) - 1] = 0;
                        if (chatfill > 0 && curbuf[chatfill - 1] != '\n')
                            chatfill--;
                        else
                        {
                            curbuf[chatfill++] = '\b';
                            curbuf[chatfill++] = ' ';
                            curbuf[chatfill++] = '\b';
                        }
                        sb_puts (chatwinl, "\b \b");
                        break;

                    default:
                        LocCommandBuf[strlen (LocCommandBuf) + 1] = 0;
                        LocCommandBuf[strlen (LocCommandBuf)] = (byte) c;
                        curbuf[chatfill++] = (byte) c;
                        if (c != 7)
                            sb_putc (chatwinl, c);
                        break;
                    }
                }
                break;
            }
    }

    if (chatfill > 0)
    {
        if (hydra_devsend ("CON", curbuf, chatfill))
        {
            curbuf = (curbuf == chatbuf1) ? chatbuf2 : chatbuf1;
            chatfill = 0;
        }
        css_upd ();
    }

    return (esc);
}                               /*keyabort() */

/* $Id: chat.cpp,v 1.1 2005/01/01 15:18:12 vildanov Exp $ */

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us