/*
* $Id$
- *
- * Functions which implement the chat and paging facilities.
*/
-
+/**
+ * \defgroup PageFunc Functions which implement the chat and paging facilities.
+ */
+/*@{*/
#include "webcit.h"
-/*
- * display the form for paging (x-messaging) another user
+/**
+ * \brief display the form for paging (x-messaging) another user
*/
void display_page(void)
{
wDumpContent(1);
}
-/*
- * page another user
+/**
+ * \brief page another user
*/
void page_user(void)
{
-/*
- * multiuser chat
+/**
+ * \brief multiuser chat
*/
void do_chat(void)
{
char buf[SIZ];
- /* First, check to make sure we're still allowed in this room. */
+ /** First, check to make sure we're still allowed in this room. */
serv_printf("GOTO %s", WC->wc_roomname);
serv_getln(buf, sizeof buf);
if (buf[0] != '2') {
return;
}
- /* If the chat socket is still open from a previous chat,
+ /**
+ * If the chat socket is still open from a previous chat,
* close it -- because it might be stale or in the wrong room.
*/
if (WC->chat_sock < 0) {
WC->chat_sock = (-1);
}
- /* WebCit Chat works by having transmit, receive, and refresh
+ /**
+ * WebCit Chat works by having transmit, receive, and refresh
* frames. Load the frameset. (This isn't AJAX but the headers
* output by begin_ajax_response() happen to be the ones we need.)
*/
}
-/*
+/**
+ * \brief display page popup
* If there are instant messages waiting, and we notice that we haven't checked them in
* a while, it probably means that we need to open the instant messenger window.
*/
{
char buf[SIZ];
- /* First, do the check as part of our page load. */
+ /** First, do the check as part of our page load. */
serv_puts("NOOP");
serv_getln(buf, sizeof buf);
if (buf[3] == '*') {
}
}
- /* Then schedule it to happen again a minute from now if the user is idle. */
+ /** Then schedule it to happen again a minute from now if the user is idle. */
wprintf("<script type=\"text/javascript\"> \n"
" function HandleSslp(sslg_xmlresponse) { \n"
" sslg_response = sslg_xmlresponse.responseText.substr(0, 1); \n"
-/*
- * Support function for chat -- make sure the chat socket is connected
+/**
+ * \brief Support function for chat
+ * make sure the chat socket is connected
* and in chat mode.
*/
int setup_chat_socket(void) {
if (WC->chat_sock < 0) {
if (!strcasecmp(ctdlhost, "uds")) {
- /* unix domain socket */
+ /** unix domain socket */
sprintf(buf, "%s/citadel.socket", ctdlport);
WC->chat_sock = uds_connectsock(buf);
}
else {
- /* tcp socket */
+ /** tcp socket */
WC->chat_sock = tcp_connectsock(ctdlhost, ctdlport);
}
return(errno);
}
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
}
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
-/*
- * Receiving side of the chat window. This is implemented in a
+/**
+ * \brief Receiving side of the chat window.
+ * This is implemented in a
* tiny hidden IFRAME that just does JavaScript writes to
* other frames whenever it refreshes and finds new data.
*/
return;
}
- /*
+ /**
* See if there is any chat data waiting.
*/
output_data = strdup("");
if (poll(&pf, 1, 1) > 0) if (pf.revents & POLLIN) {
++got_data;
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
end_chat_now = 1;
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
- /* Append our output data */
+ /** Append our output data */
output_data = realloc(output_data, strlen(output_data) + strlen(buf) + 4);
strcat(output_data, buf);
strcat(output_data, "\n");
output_data[strlen(output_data)-1] = 0;
}
- /* Output our fun to the other frame. */
+ /** Output our fun to the other frame. */
wprintf("<img src=\"static/blank.gif\" WIDTH=1 HEIGHT=1\n"
"onLoad=\" \n"
);
}
-/*
- * sending side of the chat window
+/**
+ * \brief sending side of the chat window
*/
void chat_send(void) {
int i;
return;
}
- /* Temporarily swap the serv and chat sockets during chat talk */
+ /** Temporarily swap the serv and chat sockets during chat talk */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
}
}
- /* Unswap the sockets. */
+ /** Unswap the sockets. */
i = WC->serv_sock;
WC->serv_sock = WC->chat_sock;
WC->chat_sock = i;
wDumpContent(0);
}
+/*@}*/