/**
* \brief Wrapper around iconv_open()
* Our version adds aliases for non-standard Microsoft charsets
- * such as 'MS950', aliasing them to names like 'CP950'
+ * such as 'MS950', aliasing them to names like 'CP950'
*
* \param tocode Target encoding
* \param fromcode Source encoding
int pos;
int start, end;
- char ench;
char urlbuf[SIZ];
char outbuf[1024];
-
start = (-1);
end = strlen(buf);
- ench = 0;
for (pos = 0; pos < strlen(buf); ++pos) {
if (!strncasecmp(&buf[pos], "http://", 7))
if (start < 0)
return;
- if ((start > 0) && (buf[start - 1] == '<'))
- ench = '>';
- if ((start > 0) && (buf[start - 1] == '['))
- ench = ']';
- if ((start > 0) && (buf[start - 1] == '('))
- ench = ')';
- if ((start > 0) && (buf[start - 1] == '{'))
- ench = '}';
-
for (pos = strlen(buf); pos > start; --pos) {
- if ((buf[pos] == ' ') || (buf[pos] == ench))
+ if ( (!isprint(buf[pos]))
+ || (isspace(buf[pos]))
+ || (buf[pos] == '{')
+ || (buf[pos] == '}')
+ || (buf[pos] == '|')
+ || (buf[pos] == '\\')
+ || (buf[pos] == '^')
+ || (buf[pos] == '[')
+ || (buf[pos] == ']')
+ || (buf[pos] == '`')
+ || (buf[pos] == '<')
+ || (buf[pos] == '>')
+ || (buf[pos] == '(')
+ || (buf[pos] == ')')
+ ) {
end = pos;
+ }
}
strncpy(urlbuf, &buf[start], end - start);
void read_message(long msgnum, int printable_view, char *section) {
char buf[SIZ];
char mime_partnum[256];
+ char mime_name[256];
char mime_filename[256];
char mime_content_type[256];
char mime_charset[256];
}
if (!strncasecmp(buf, "part=", 5)) {
+ extract_token(mime_name, &buf[5], 0, '|', sizeof mime_filename);
extract_token(mime_filename, &buf[5], 1, '|', sizeof mime_filename);
extract_token(mime_partnum, &buf[5], 2, '|', sizeof mime_partnum);
extract_token(mime_disposition, &buf[5], 3, '|', sizeof mime_disposition);
extract_token(mime_content_type, &buf[5], 4, '|', sizeof mime_content_type);
mime_length = extract_int(&buf[5], 5);
+ striplt(mime_name);
+ striplt(mime_filename);
+ if ( (strlen(mime_filename) == 0) && (strlen(mime_name) > 0) ) {
+ strcpy(mime_filename, mime_name);
+ }
+
if (!strcasecmp(mime_content_type, "message/rfc822")) {
if (strlen(mime_submessages) > 0) {
strcat(mime_submessages, "|");
}
/** If this is one of my own rooms, or if I'm an Aide or Room Aide, I can move/delete */
- if ( (WC->is_room_aide) || (WC->is_mailbox) ) {
+ if ( (WC->is_room_aide) || (WC->is_mailbox) || (WC->room_flags2 & QR2_COLLABDEL) ) {
/** Move */
wprintf("<a href=\"confirm_move_msg?msgid=%ld\">[%s]</a> ",
msgnum, _("Move"));
/**
* \brief Read message in simple, JavaScript-embeddable form for 'forward'
- * or 'reply quoted' operations.
+ * or 'reply quoted' operations.
*
* NOTE: it is VITALLY IMPORTANT that we output no single-quotes or linebreaks
* in this function. Doing so would throw a JavaScript error in the
escputs(bstr("recp"));
wprintf("\" size=50 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"recp_name_choices\"></div>");
+
+ /** Pop open an address book -- begin **/
+
+ wprintf(
+ "<a href=\"javascript:PopOpenAddressBook();\" title=\"%s\">"
+ "<img border=0 width=16 height=16 src=\"static/viewcontacts_16x.gif\">"
+ "</a>", _("Contacts")
+ );
+
+ /** Pop open an address book -- end **/
+
wprintf("</td><td></td></tr>\n");
wprintf("<tr><td>");
}
wprintf("</form>\n");
-
wprintf("</td></tr></table></div>\n");
+
+ wprintf("</div>\n"); /* End of 'content' div */
+
+ /* Open a new div, hidden initially, for address book popups.
+ * FIXME put this in its own function so we can use it from the
+ * calendar too.
+ */
+ wprintf("<div id=\"address_book_popup\" style=\"display:none;\">");
+ wprintf("<div id=\"address_book_popup_container_div\">");
+ wprintf("<div id=\"address_book_popup_middle_div\"></div>");
+ wprintf("<div id=\"address_book_inner_div\"></div>");
+ wprintf("</div>");
+ /* The 'address_book_popup' div will be closed by wDumpContent() */
DONE: wDumpContent(1);
}
-
/**
* \brief delete a message
*/