Back to index

webcit  8.12-dfsg
Functions
paging.c File Reference
#include "webcit.h"

Go to the source code of this file.

Functions

void display_page (void)
void page_user (void)
int Conditional_PAGE_WAITING (StrBuf *Target, WCTemplputParams *TP)
void ajax_send_instant_message (void)
void InitModule_PAGING (void)
void SessionDestroyModule_PAGING (wcsession *sess)

Function Documentation

void ajax_send_instant_message ( void  )

Definition at line 122 of file paging.c.

                                     {
       char recp[256];
       char buf[256];

       safestrncpy(recp, bstr("recp"), sizeof recp);

       serv_printf("SEXP %s|-", recp);
       serv_getln(buf, sizeof buf);

       if (buf[0] == '4') {
              text_to_server(bstr("msg"));
              serv_puts("000");
       }

       escputs(buf); /* doesn't really matter what we return - the client ignores it */
}

Here is the call graph for this function:

Here is the caller graph for this function:

int Conditional_PAGE_WAITING ( StrBuf *  Target,
WCTemplputParams TP 
)

JavaScript function to alert the user that popups are probably blocked

First, do the check as part of our page load.

Definition at line 103 of file paging.c.

{
       int len;
       char buf[SIZ];

       serv_puts("NOOP");
       len = serv_getln(buf, sizeof buf);
       if ((len >= 3) && (buf[3] == '*')) {
              if ((time(NULL) - WC->last_pager_check) > 60) {
                     return 1;
              }
       }
       return 0;
       /* Then schedule it to happen again a minute from now if the user is idle. */
}

Here is the call graph for this function:

Here is the caller graph for this function:

void display_page ( void  )

Definition at line 20 of file paging.c.

{
       char recp[SIZ];

       strcpy(recp, bstr("recp"));

        output_headers(1, 1, 1, 0, 0, 0);
        wc_printf("<div id=\"room_banner_override\">\n");
        wc_printf("<h1>");
       wc_printf(_("Send instant message"));
       wc_printf("</h1>");
        wc_printf("</div>\n");

       wc_printf("<div id=\"content\" class=\"service\">\n");

       wc_printf("<table class=\"paging_background\"><tr><td>\n");

       wc_printf(_("Send an instant message to: "));
       escputs(recp);
       wc_printf("<br>\n");

       wc_printf("<FORM METHOD=\"POST\" action=\"page_user\">\n");
       wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
       wc_printf("<input type=\"hidden\" name=\"template\" value=\"who\">\n");

       wc_printf("<TABLE border=0 width=100%%><TR><TD>\n");

       wc_printf("<INPUT TYPE=\"hidden\" NAME=\"recp\" VALUE=\"");
       escputs(recp);
       wc_printf("\">\n");

       wc_printf(_("Enter message text:"));
       wc_printf("<br>");

       wc_printf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=5 COLS=40 "
              "WIDTH=40></TEXTAREA>\n");

       wc_printf("</TD></TR></TABLE><br>\n");

       wc_printf("<INPUT TYPE=\"submit\" NAME=\"send_button\" VALUE=\"%s\">", _("Send message"));
       wc_printf("<br><a href=\"javascript:window.close();\"%s</A>\n", _("Cancel"));

       wc_printf("</FORM></CENTER>\n");
       wc_printf("</td></tr></table>\n");
       wDumpContent(1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void InitModule_PAGING ( void  )

Definition at line 142 of file paging.c.

{
       WebcitAddUrlHandler(HKEY("display_page"), "", 0, display_page, 0);
       WebcitAddUrlHandler(HKEY("page_user"), "", 0, page_user, 0);
       WebcitAddUrlHandler(HKEY("ajax_send_instant_message"), "", 0, ajax_send_instant_message, AJAX);
       RegisterConditional(HKEY("COND:PAGE:WAITING"), 0, Conditional_PAGE_WAITING, CTX_NONE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void page_user ( void  )

Definition at line 70 of file paging.c.

{
       char recp[256];
       StrBuf *Line;

       safestrncpy(recp, bstr("recp"), sizeof recp);

       if (!havebstr("send_button")) {
              AppendImportantMessage(_("Message was not sent."), -1);
       } else {
              Line = NewStrBuf();
              serv_printf("SEXP %s|-", recp);
              StrBuf_ServGetln(Line);
              if (GetServerStatusMsg(Line, NULL, 0, 0) == 4) {
                     char buf[256];
                     text_to_server(bstr("msgtext"));
                     serv_puts("000");
                     stresc(buf, 256, recp, 0, 0);
                     AppendImportantMessage(buf, -1);
                     AppendImportantMessage(_("Message has been sent to "), -1);
              }
       }

       url_do_template();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 153 of file paging.c.

{
       /* nothing here anymore */
}

Here is the caller graph for this function: