}
+
+/*
+ * Retrieve the "seen" message list for the current room.
+ */
+void CtdlGetSeen(char *buf) {
+ struct visit vbuf;
+
+ /* Learn about the user and room in question */
+ CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
+
+ safestrncpy(buf, vbuf.v_seen, SIZ);
+}
+
+
+
/*
* Manipulate the "seen msgs" string.
*/
int num_msgs = 0;
/* Learn about the user and room in question */
- get_mm();
- getuser(&CC->usersupp, CC->curr_user);
CtdlGetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
/* Load the message list */
if ( (!strcasecmp(cbtype, "text/plain"))
|| (strlen(cbtype)==0) ) {
- wlen = length;
wptr = content;
- while (wlen--) {
- ch = *wptr++;
- /**********
- if (ch==10) cprintf("\r\n");
- else cprintf("%c", ch);
- **********/
- cprintf("%c", ch);
+ if (length > 0) {
+ client_write(wptr, length);
+ if (wptr[length-1] != '\n') {
+ cprintf("\n");
+ }
}
- if (ch != '\n') cprintf("\n");
}
else if (!strcasecmp(cbtype, "text/html")) {
ptr = html_to_ascii(content, 80, 0);
wlen = strlen(ptr);
- wptr = ptr;
- while (wlen--) {
- ch = *wptr++;
- if (ch==10) cprintf("\r\n");
- else cprintf("%c", ch);
+ client_write(ptr, wlen);
+ if (ptr[wlen-1] != '\n') {
+ cprintf("\n");
}
phree(ptr);
}
if (getuser(&userbuf, recipient) == 0) {
MailboxName(actual_rm, sizeof actual_rm, &userbuf, MAILROOM);
CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0);
+ BumpNewMailCounter(userbuf.usernum);
}
else {
lprintf(9, "No user <%s>\n", recipient);