]> code.citadel.org Git - citadel.git/blobdiff - webcit/paging.c
New way to display incoming instant messages. Not finished.
[citadel.git] / webcit / paging.c
index c9d14b9272ccd34f9a70f0fa6f0bf016877b37d1..ba9c056f82c683bdf60ce361d8d41ae8e3cf15f2 100644 (file)
@@ -154,29 +154,18 @@ void do_chat(void)
 void page_popup(void)
 {
        char buf[SIZ];
-       char pagefrom[SIZ];
 
-       while (serv_puts("GEXP"), serv_getln(buf, sizeof buf), buf[0]=='1') {
-
-               extract_token(pagefrom, &buf[4], 3, '|', sizeof pagefrom);
-
-               wprintf("<table border=1 bgcolor=\"#880000\"><tr><td>");
-               wprintf("<span class=\"titlebar\">");
-               wprintf(_("Instant message from "));
-               escputs(pagefrom);
-               wprintf("</span></td></tr><tr><td><font color=\"#FFFFFF\">");
-               fmout("LEFT");
-               wprintf("</font></td></tr>"
-                       "<tr><td><div align=center><font color=\"#FFFFFF\">"
-                       "<a href=\"javascript:hide_page_popup()\">");
-               wprintf(_("[ close window ]"));
-               wprintf("</a>"
-                       "</font></div>"
-                       "</td></tr>"
-                       "</table>\n");
+       serv_puts("NOOP");
+       serv_getln(buf, sizeof buf);
+       if (buf[3] == '*') {
+               if ((time(NULL) - WC->last_pager_check) > 120) {
+                       wprintf("<script type=\"text/javascript\">"
+                               " window.open('static/instant_messenger.html', 'CTDL_MESSENGER', "
+                               " 'width=600,height=400');"
+                               "</script>"
+                       );      
+               }
        }
-
-       WC->HaveInstantMessages = 0;
 }
 
 
@@ -481,4 +470,3 @@ void chat_send(void) {
        wDumpContent(0);
 }
 
-