struct uiuser *users = NULL;
struct uidata *actives = NULL;
struct socket *uisocket = NULL;
+static time_t starttime;
static wchar_t *quoteword(wchar_t *word)
{
sq(sk, 0, L"200", L"Message sent", NULL);
}
+static void cmd_uptime(struct socket *sk, struct uidata *data, int argc, wchar_t **argv)
+{
+ sq(sk, 0, L"200", L"%%i", time(NULL) - starttime, NULL);
+}
+
#undef haveargs
#undef havepriv
{L"transstatus", cmd_transstatus},
{L"register", cmd_register},
{L"sendmsg", cmd_sendmsg},
+ {L"uptime", cmd_uptime},
{NULL, NULL}
};
}
if(!hup)
{
+ starttime = time(NULL);
if(uisocket != NULL)
putsock(uisocket);
if((uisocket = netcstcplisten(confgetint("ui", "port"), 1, uiaccept, NULL)) == NULL)