diff --git a/mbsetup/m_ibc.c b/mbsetup/m_ibc.c index f63347ba..a5c640d4 100644 --- a/mbsetup/m_ibc.c +++ b/mbsetup/m_ibc.c @@ -232,21 +232,23 @@ int EditIBCRec(int Area) set_color(CYAN, BLACK); mbse_mvprintw( 7, 2, "1. Comment"); mbse_mvprintw( 8, 2, "2. Server"); - mbse_mvprintw( 9, 2, "3. Password"); - mbse_mvprintw(10, 2, "4. Active"); - mbse_mvprintw(11, 2, "5. Deleted"); - mbse_mvprintw(12, 2, "6. Compress"); + mbse_mvprintw( 9, 2, "3. Myname"); + mbse_mvprintw(10, 2, "4. Password"); + mbse_mvprintw(11, 2, "5. Active"); + mbse_mvprintw(12, 2, "6. Deleted"); + mbse_mvprintw(13, 2, "7. Compress"); for (;;) { set_color(WHITE, BLACK); show_str( 7,16,40, ibcsrv.comment); show_str( 8,16,63, ibcsrv.server); - show_str( 9,16,15, ibcsrv.passwd); - show_bool(10,16, ibcsrv.Active); - show_bool(11,16, ibcsrv.Deleted); - show_bool(12,16, ibcsrv.Compress); + show_str( 9,16,63, ibcsrv.myname); + show_str( 10,16,15, ibcsrv.passwd); + show_bool(11,16, ibcsrv.Active); + show_bool(12,16, ibcsrv.Deleted); + show_bool(13,16, ibcsrv.Compress); - j = select_menu(6); + j = select_menu(7); switch(j) { case 0: crc1 = 0xffffffff; crc1 = upd_crc32((char *)&ibcsrv, crc1, sizeof(ibcsrv)); @@ -267,11 +269,12 @@ int EditIBCRec(int Area) IsDoing("Browsing Menu"); return 0; case 1: E_STR( 7,16,40,ibcsrv.comment, "The ^Comment^ for this record") - case 2: E_STR( 8,16,64,ibcsrv.server, "The internet ^name^ or ^IP^ address of the server") - case 3: E_STR( 9,16,64,ibcsrv.passwd, "The ^password^ for this server") - case 4: E_BOOL(10,16, ibcsrv.Active, "Switch if this server is ^Active^ for chat") - case 5: E_BOOL(11,16, ibcsrv.Deleted, "Is this server to be ^Deleted^") - case 6: E_BOOL(12,16, ibcsrv.Compress, "Use ^zlib compression^ with this server") + case 2: E_STR( 8,16,63,ibcsrv.server, "The known internet ^name^ or ^IP^ address of the remote server") + case 3: E_STR( 9,16,63,ibcsrv.myname, "The known internet ^name^ or ^IP^ address of this server") + case 4: E_STR( 10,16,64,ibcsrv.passwd, "The ^password^ for this server") + case 5: E_BOOL(11,16, ibcsrv.Active, "Switch if this server is ^Active^ for chat") + case 6: E_BOOL(12,16, ibcsrv.Deleted, "Is this server to be ^Deleted^") + case 7: E_BOOL(13,16, ibcsrv.Compress, "Use ^zlib compression^ with this server") } } @@ -327,11 +330,13 @@ void EditIBC(void) x = 42; y = 7; } - if (ibcsrv.Active) + if (ibcsrv.Deleted) + set_color(LIGHTRED, BLACK); + else if (ibcsrv.Active) set_color(CYAN, BLACK); else set_color(LIGHTBLUE, BLACK); - sprintf(temp, "%3d. %-32s", i, ibcsrv.comment); + sprintf(temp, "%3d. %s (%s)", i, ibcsrv.server, ibcsrv.comment); temp[37] = 0; mbse_mvprintw(y, x, temp); y++; @@ -410,6 +415,7 @@ int ibc_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "
\n"); add_webtable(wp, (char *)"Server comment", ibcsrv.comment); add_webtable(wp, (char *)"Server address", ibcsrv.server); + add_webtable(wp, (char *)"My address", ibcsrv.myname); add_webtable(wp, (char *)"Active", getboolean(ibcsrv.Active)); add_webtable(wp, (char *)"Compresion", getboolean(ibcsrv.Compress)); fprintf(wp, "\n"); @@ -419,6 +425,7 @@ int ibc_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Comment %s\n", ibcsrv.comment); fprintf(fp, " Server %s\n", ibcsrv.server); + fprintf(fp, " My name %s\n", ibcsrv.myname); fprintf(fp, " Active %s\n", getboolean(ibcsrv.Active)); fprintf(fp, " Compression %s\n", getboolean(ibcsrv.Compress)); fprintf(fp, "\n\n\n"); diff --git a/mbtask/taskibc.c b/mbtask/taskibc.c index a954fc50..20a2fa2a 100644 --- a/mbtask/taskibc.c +++ b/mbtask/taskibc.c @@ -59,8 +59,8 @@ static char *ncsstate[] = { /* * Add a port to the portlist */ -void fill_ncslist(ncs_list **, char *, char *); -void fill_ncslist(ncs_list **fdp, char *server, char *passwd) +void fill_ncslist(ncs_list **, char *, char *, char *); +void fill_ncslist(ncs_list **fdp, char *server, char *myname, char *passwd) { ncs_list *tmp, *ta; @@ -68,6 +68,7 @@ void fill_ncslist(ncs_list **fdp, char *server, char *passwd) memset(tmp, 0, sizeof(tmp)); tmp->next = NULL; strncpy(tmp->server, server, 63); + strncpy(tmp->server, myname, 63); strncpy(tmp->passwd, passwd, 15); tmp->state = NCS_INIT; tmp->action = time(NULL); @@ -166,7 +167,7 @@ void check_servers(void) } if (!inlist ) { Syslog('r', " not in neighbour list, add"); - fill_ncslist(&ncsl, ibcsrv.server, ibcsrv.passwd); + fill_ncslist(&ncsl, ibcsrv.server, ibcsrv.myname, ibcsrv.passwd); changed = TRUE; Syslog('+', "Added Internet BBS Chatserver %s", ibcsrv.server); } @@ -262,7 +263,7 @@ void check_servers(void) case NCS_CALL: Syslog('r', "%s call", tnsl->server); sprintf(buf, "PASS %s 0000 IBC| %s\r", tnsl->passwd, tnsl->compress ? "Z":""); send_msg(tnsl->socket, tnsl->servaddr_in, tnsl->server, buf); - sprintf(buf, "SERVER seaport 0 %ld mbsebbs v%s\r", tnsl->token, VERSION); + sprintf(buf, "SERVER %s 0 %ld mbsebbs v%s\r", tnsl->myname, tnsl->token, VERSION); send_msg(tnsl->socket, tnsl->servaddr_in, tnsl->server, buf); tnsl->action = now + (time_t)50; tnsl->state = NCS_WAITPWD; diff --git a/mbtask/taskibc.h b/mbtask/taskibc.h index 7834ffc8..44863d38 100644 --- a/mbtask/taskibc.h +++ b/mbtask/taskibc.h @@ -12,6 +12,7 @@ typedef struct _ncs_list { struct _ncs_list *next; char server[64]; /* Server address */ + char myname[64]; /* My server address */ char passwd[16]; /* Server password */ int state; /* Connection state */ time_t action; /* Time for next action */