From f3f5eb2be53fa14e84ed563c229098c0fcd290f5 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Fri, 9 Feb 2007 22:00:16 +0000 Subject: Trying a login script... --- vchat-config.h | 49 +++++++++++++++++++++++++------------------------ vchat-protocol.c | 2 +- vchat.h | 2 +- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/vchat-config.h b/vchat-config.h index ce9c72d..d494736 100755 --- a/vchat-config.h +++ b/vchat-config.h @@ -28,30 +28,31 @@ extern unsigned int usetime; extern unsigned int hscroll; static volatile configoption configoptions[] = { -/* config-option type name in file default value value localvar */ - {CF_NICK, CO_STR, "nick", NULL, NULL, { .pstr = &nick } }, - {CF_FROM, CO_STR, "from", "vc-alpha-0.16", NULL, { NULL } }, - {CF_SERVERHOST, CO_STR, "host", "pulse.flatline.de",NULL, { NULL } }, - {CF_SERVERPORT, CO_STR, "port", "2325", NULL, { NULL } }, - {CF_CIPHERSUITE, CO_STR, "ciphers", "HIGH:MEDIUM", NULL, { NULL } }, - {CF_CONFIGFILE, CO_STR, "conffile", "~/.vchat/config", NULL, { NULL } }, - {CF_CERTFILE, CO_STR, "certfile", "~/.vchat/cert", NULL, { NULL } }, - {CF_KEYFILE, CO_STR, "keyfile", "~/.vchat/key", NULL, { NULL } }, - {CF_FORMFILE, CO_STR, "formatfile", "~/.vchat/formats", NULL, { NULL } }, - {CF_ENCODING, CO_STR, "encoding", NULL, NULL, { .pstr = &encoding }}, - {CF_USESSL, CO_INT, "usessl", (char *) 1, (char *)-1, { .pint = &usessl } }, - {CF_USECERT, CO_INT, "usecert", (char *) 1, (char *)-1, { NULL } }, - {CF_USETIME, CO_INT, "usetime", (char *) 1, (char *)-1, { .pint = &usetime } }, - {CF_USETOPIC, CO_INT, "usetopicbar",(char *) 1, (char *)-1, { NULL } }, - {CF_PRIVHEIGHT, CO_INT, "messages", (char *) 0, (char *)-1, { NULL } }, - {CF_HSCROLL, CO_INT, "hscroll", (char *) 5, (char *)-1, { .pint = &hscroll } }, - {CF_CHANNEL, CO_INT, "channel", (char *) 0, (char *)-1, { NULL } }, - {CF_SCROLLBPRIV, CO_INT, "privscrollb",(char *) 2048, (char *)-1, { NULL } }, - {CF_SCROLLBACK, CO_INT, "scrollback", (char *) 8192, (char *)-1, { NULL } }, - {CF_SCROLLBPRIVT,CO_INT, "privscrollt",(char *) 0, (char *)-1, { NULL } }, - {CF_SCROLLBACKT, CO_INT, "scrolltime", (char *) 86400, (char *)-1, { NULL } }, - {CF_BELLPRIV, CO_INT, "bellonpm", (char *) 0, (char *)-1, { NULL } }, - {CF_NIL, CO_NIL, NULL, NULL, NULL, { NULL } }, +/* config-option type name in file default value value localvar */ + {CF_NICK, CO_STR, "nick", NULL, NULL, { .pstr = &nick } }, + {CF_FROM, CO_STR, "from", "vc-alpha-0.16", NULL, { NULL } }, + {CF_SERVERHOST, CO_STR, "host", "pulse.flatline.de", NULL, { NULL } }, + {CF_SERVERPORT, CO_STR, "port", "2325", NULL, { NULL } }, + {CF_CIPHERSUITE, CO_STR, "ciphers", "HIGH:MEDIUM", NULL, { NULL } }, + {CF_CONFIGFILE, CO_STR, "conffile", "~/.vchat/config", NULL, { NULL } }, + {CF_CERTFILE, CO_STR, "certfile", "~/.vchat/cert", NULL, { NULL } }, + {CF_KEYFILE, CO_STR, "keyfile", "~/.vchat/key", NULL, { NULL } }, + {CF_FORMFILE, CO_STR, "formatfile", "~/.vchat/formats", NULL, { NULL } }, + {CF_LOGINSCRIPT, CO_STR, "loginscript","~/.vchat/loginscript", NULL, { NULL } }, + {CF_ENCODING, CO_STR, "encoding", NULL, NULL, { .pstr = &encoding }}, + {CF_USESSL, CO_INT, "usessl", (char *) 1, (char *)-1, { .pint = &usessl } }, + {CF_USECERT, CO_INT, "usecert", (char *) 1, (char *)-1, { NULL } }, + {CF_USETIME, CO_INT, "usetime", (char *) 1, (char *)-1, { .pint = &usetime } }, + {CF_USETOPIC, CO_INT, "usetopicbar",(char *) 1, (char *)-1, { NULL } }, + {CF_PRIVHEIGHT, CO_INT, "messages", (char *) 0, (char *)-1, { NULL } }, + {CF_HSCROLL, CO_INT, "hscroll", (char *) 5, (char *)-1, { .pint = &hscroll } }, + {CF_CHANNEL, CO_INT, "channel", (char *) 0, (char *)-1, { NULL } }, + {CF_SCROLLBPRIV, CO_INT, "privscrollb",(char *) 2048, (char *)-1, { NULL } }, + {CF_SCROLLBACK, CO_INT, "scrollback", (char *) 8192, (char *)-1, { NULL } }, + {CF_SCROLLBPRIVT,CO_INT, "privscrollt",(char *) 0, (char *)-1, { NULL } }, + {CF_SCROLLBACKT, CO_INT, "scrolltime", (char *) 86400, (char *)-1, { NULL } }, + {CF_BELLPRIV, CO_INT, "bellonpm", (char *) 0, (char *)-1, { NULL } }, + {CF_NIL, CO_NIL, NULL, NULL, NULL, { NULL } }, }; /* diff --git a/vchat-protocol.c b/vchat-protocol.c index 5554796..c1e88c5 100755 --- a/vchat-protocol.c +++ b/vchat-protocol.c @@ -564,7 +564,7 @@ justloggedin (char *message) /* we're not logged in, change status and request nicks */ if (!loggedin) { - networkoutput (".S"); + loadcfg(getstroption(CF_LOGINSCRIPT),handleline); loggedin = 1; } } diff --git a/vchat.h b/vchat.h index 60d485d..2cc4e12 100755 --- a/vchat.h +++ b/vchat.h @@ -36,7 +36,7 @@ typedef struct servermessage servermessage; /* configuration types and variable numbers */ typedef enum { CO_NIL, CO_STR, CO_INT } conftype; typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT, -CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, +CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGINSCRIPT, CF_USESSL, CF_USECERT, CF_PRIVHEIGHT, CF_HSCROLL, CF_CHANNEL, CF_USETIME, CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, CF_ENCODING, CF_BELLPRIV } confopt; -- cgit v1.2.3