]> code.citadel.org Git - citadel.git/blobdiff - webcit/pushemail.c
* add new 'Context' Parameter to the template call
[citadel.git] / webcit / pushemail.c
index 019e0fa1bea1b50852521ef8e3a3b9e6b7e30d69..d4e06bed52e2fd450b583fd39c24d341369fc226 100644 (file)
@@ -10,7 +10,8 @@ void display_pushemail(void) {
        int is_pager = 0;
        int is_funambol = 0;
        char mobnum[20];
-       svprintf("BOXTITLE", WCS_STRING, _("Push email and SMS settings"));
+
+       svput("BOXTITLE", WCS_STRING, _("Push email and SMS settings"));
        
        /* Find any existing settings*/
        if (goto_config_room() == 0) {
@@ -26,7 +27,7 @@ void display_pushemail(void) {
                        
                }
                if (msgnum > 0L) {
-               serv_printf("MSG0 %ld", msgnum);
+               serv_printf("MSG0 %d", msgnum);
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1') {
                        while (serv_getln(buf, sizeof buf),
@@ -51,20 +52,20 @@ void display_pushemail(void) {
                }
                }
        if (is_none) {
-               svprintf("PUSH_NONE", WCS_STRING, "checked=\"checked\"");
+               svput("PUSH_NONE", WCS_STRING, "checked=\"checked\"");
        } else if (is_pager) {
-               svprintf("PUSH_TEXT", WCS_STRING, "checked=\"checked\"");
-               svprintf("SMSNUM", WCS_STRING, "value=\"%s\"", mobnum);
+               svput("PUSH_TEXT", WCS_STRING, "checked=\"checked\"");
+               svprintf(HKEY("SMSNUM"), WCS_STRING, "value=\"%s\"", mobnum);
        } else if (is_funambol) {
-               svprintf("PUSH_FNBL", WCS_STRING, "checked=\"checked\"");
+               svput("PUSH_FNBL", WCS_STRING, "checked=\"checked\"");
        }
        serv_printf("GOTO %s", WC->wc_roomname);
        serv_getln(buf, sizeof  buf);
        }
-output_headers(1, 1, 2, 0, 0, 0);
-do_template("pushemail");
+       output_headers(1, 1, 2, 0, 0, 0);
+       do_template("pushemail", NULL);
 //do_template("endbox");
-wDumpContent(1);
+       wDumpContent(1);
 }
 
 void save_pushemail(void) {
@@ -90,7 +91,7 @@ void save_pushemail(void) {
        }
 
        if (msgnum > 0L) {
-               serv_printf("DELE %ld", msgnum);
+               serv_printf("DELE %d", msgnum);
                serv_getln(buf, sizeof buf);
        }
 
@@ -110,3 +111,11 @@ void save_pushemail(void) {
        serv_getln(buf, sizeof buf);
        http_redirect("display_pushemail");
 }
+
+void 
+InitModule_PUSHMAIL
+(void)
+{
+       WebcitAddUrlHandler(HKEY("display_pushemail"), display_pushemail, 0);
+       WebcitAddUrlHandler(HKEY("save_pushemail"), save_pushemail, 0);
+}