return;
}
- startmsg = atol(bstr("startmsg"));
- maxmsgs = atoi(bstr("maxmsgs"));
- is_summary = atoi(bstr("is_summary"));
+ startmsg = lbstr("startmsg");
+ maxmsgs = ibstr("maxmsgs");
+ is_summary = ibstr("is_summary");
if (maxmsgs == 0) maxmsgs = DEFAULT_MAXMSGS;
snprintf(sortpref_name, sizeof sortpref_name, "sort %s", WCC->wc_roomname);
}
}
- is_singlecard = atoi(bstr("is_singlecard"));
+ is_singlecard = ibstr("is_singlecard");
if (WCC->wc_default_view == VIEW_CALENDAR) { /**< calendar */
is_calendar = 1;
struct wcsession *WCC = WC;
char *ptr = NULL;
- if (!IsEmptyStr(bstr("force_room"))) {
+ if (havebstr("force_room")) {
gotoroom(bstr("force_room"));
}
return;
}
- if (!IsEmptyStr(bstr("cancel_button"))) {
+ if (havebstr("cancel_button")) {
sprintf(WCC->ImportantMessage,
_("Cancelled. Message was not posted."));
- } else if (!IsEmptyStr(bstr("attach_button"))) {
+ } else if (havebstr("attach_button")) {
display_enter();
return;
- } else if (atol(bstr("postseq")) == dont_post) {
+ } else if (lbstr("postseq") == dont_post) {
sprintf(WCC->ImportantMessage,
_("Automatically cancelled because you have already "
"saved this message."));
if (encoded_subject) free(encoded_subject);
if (buf[0] == '4') {
post_mime_to_server();
- if ( (!IsEmptyStr(bstr("recp")))
- || (!IsEmptyStr(bstr("cc" )))
- || (!IsEmptyStr(bstr("bcc" )))
+ if ( (havebstr("recp"))
+ || (havebstr("cc" ))
+ || (havebstr("bcc" ))
) {
sprintf(WCC->ImportantMessage, _("Message has been sent.\n"));
}
else {
sprintf(WC->ImportantMessage, _("Message has been posted.\n"));
}
- dont_post = atol(bstr("postseq"));
+ dont_post = lbstr("postseq");
} else {
lprintf(9, "%s:%d: server post error: %s\n", __FILE__, __LINE__, buf);
sprintf(WC->ImportantMessage, "%s", &buf[4]);
* We may have been supplied with instructions regarding the location
* to which we must return after posting. If found, go there.
*/
- if (!IsEmptyStr(bstr("return_to"))) {
+ if (havebstr("return_to")) {
http_redirect(bstr("return_to"));
}
/**
* If we were editing a page in a wiki room, go to that page now.
*/
- else if (!IsEmptyStr(bstr("wikipage"))) {
+ else if (havebstr("wikipage")) {
snprintf(buf, sizeof buf, "wiki?page=%s", bstr("wikipage"));
http_redirect(buf);
}
int i;
int is_anonymous = 0;
long existing_page = (-1L);
+ size_t dplen;
now = time(NULL);
- if (!IsEmptyStr(bstr("force_room"))) {
+ if (havebstr("force_room")) {
gotoroom(bstr("force_room"));
}
- display_name = bstr("display_name");
+ display_name = xbstr("display_name", &dplen);
if (!strcmp(display_name, "__ANONYMOUS__")) {
display_name = "";
+ dplen = 0;
is_anonymous = 1;
}
/* Now check our actual recipients if there are any */
if (recipient_required) {
- sprintf(buf, "ENT0 0|%s|%d|0||%s||%s|%s|%s",
- bstr("recp"),
+ const char *Recp = "";
+ const char *Cc = "";
+ const char *Bcc = "";
+ const char *Wikipage = "";
+ char *CmdBuf = NULL;;
+ size_t len = 0;
+ size_t nLen;
+ const char CMD[] = "ENT0 0|%s|%d|0||%s||%s|%s|%s";
+
+ len = sizeof(CMD) + dplen;
+ Recp = xbstr("recp", &nLen);
+ len += nLen;
+ Cc = xbstr("cc", &nLen);
+ len += nLen;
+ Bcc = xbstr("bcc", &nLen);
+ len += nLen;
+ Wikipage = xbstr("wikipage", &nLen);
+ len += nLen;
+
+
+ CmdBuf = (char*) malloc (len + 1);
+
+ snprintf(CmdBuf, len, CMD,
+ Recp,
is_anonymous,
display_name,
- bstr("cc"), bstr("bcc"), bstr("wikipage"));
+ Cc, Bcc, Wikipage);
serv_puts(buf);
serv_getln(buf, sizeof buf);
if (!strncmp(buf, "570", 3)) { /** 570 means we have an invalid recipient listed */
- if (!IsEmptyStr(bstr("recp")) &&
- !IsEmptyStr(bstr("cc" )) &&
- !IsEmptyStr(bstr("bcc" ))) {
+ if (havebstr("recp") &&
+ havebstr("cc" ) &&
+ havebstr("bcc" )) {
recipient_bad = 1;
}
}
wprintf(_("To:"));
wprintf("</label></th>"
"<td><input autocomplete=\"off\" type=\"text\" name=\"recp\" id=\"recp_id\" value=\"");
- ccraw = bstr("recp");
- len = strlen(ccraw);
+ ccraw = xbstr("recp", &len);
copy = (char*) malloc(len * 2 + 1);
memcpy(copy, ccraw, len + 1);
utf8ify_rfc822_string(copy);
wprintf(_("CC:"));
wprintf("</label></th>"
"<td><input autocomplete=\"off\" type=\"text\" name=\"cc\" id=\"cc_id\" value=\"");
- ccraw = bstr("cc");
- len = strlen(ccraw);
+ ccraw = xbstr("cc", &len);
copy = (char*) malloc(len * 2 + 1);
memcpy(copy, ccraw, len + 1);
utf8ify_rfc822_string(copy);
wprintf(_("BCC:"));
wprintf("</label></th>"
"<td><input autocomplete=\"off\" type=\"text\" name=\"bcc\" id=\"bcc_id\" value=\"");
- ccraw = bstr("bcc");
- len = strlen(ccraw);
+ ccraw = xbstr("bcc", &len);
copy = (char*) malloc(len * 2 + 1);
memcpy(copy, ccraw, len + 1);
utf8ify_rfc822_string(copy);
msgescputs(bstr("msgtext"));
/* If we're forwarding a message, insert it here... */
- if (atol(bstr("fwdquote")) > 0L) {
+ if (lbstr("fwdquote") > 0L) {
wprintf("<br><div align=center><i>");
wprintf(_("--- forwarded message ---"));
wprintf("</i></div><br>");
- pullquote_message(atol(bstr("fwdquote")), 1, 1);
+ pullquote_message(lbstr("fwdquote"), 1, 1);
}
/** If we're replying quoted, insert the quote here... */
- else if (atol(bstr("replyquote")) > 0L) {
+ else if (lbstr("replyquote") > 0L) {
wprintf("<br>"
"<blockquote>");
- pullquote_message(atol(bstr("replyquote")), 0, 1);
+ pullquote_message(lbstr("replyquote"), 0, 1);
wprintf("</blockquote><br>");
}
}
/** Insert our signature if appropriate... */
- if ( (WC->is_mailbox) && (strcmp(bstr("sig_inserted"), "yes")) ) {
+ if ( (WC->is_mailbox) && yesbstr("sig_inserted") ) {
get_preference("use_sig", buf, sizeof buf);
if (!strcasecmp(buf, "yes")) {
int len;
long msgid;
char buf[SIZ];
- msgid = atol(bstr("msgid"));
+ msgid = lbstr("msgid");
if (WC->wc_is_trash) { /** Delete from Trash is a real delete */
serv_printf("DELE %ld", msgid);
long msgid;
char buf[SIZ];
- msgid = atol(bstr("msgid"));
+ msgid = lbstr("msgid");
- if (!IsEmptyStr(bstr("move_button"))) {
+ if (havebstr("move_button")) {
sprintf(buf, "MOVE %ld|%s", msgid, bstr("target_room"));
serv_puts(buf);
serv_getln(buf, sizeof buf);
char buf[SIZ];
char targ[SIZ];
- msgid = atol(bstr("msgid"));
+ msgid = lbstr("msgid");
output_headers(1, 1, 2, 0, 0, 0);