Fri Oct 9 18:34:06 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* user_ops.c: added PurgeStaleRelationships() to do processing at
session logout time to remove visits for rooms which no longer exist
+ * user_ops.c: implemented NewMailCount()
1998-10-09 Nathan Bryant <bryant@cs.usm.maine.edu>
* serv_chat.c: fix buffer overrun that was resulting in segv's
*/
int NewMailCount() {
int num_newmsgs = 0;
+ int a;
char mailboxname[32];
+ struct quickroom mailbox;
+ struct visit vbuf;
MailboxName(mailboxname, &CC->usersupp, MAILROOM);
-
- /* FIX FIX FIX FIX FIX This needs implementation */
+ if (getroom(&mailbox, mailboxname)!=0) return(0);
+ CtdlGetRelationship(&vbuf, &CC->usersupp, &mailbox);
+
+ get_msglist(&mailbox);
+ for (a=0; a<CC->num_msgs; ++a) {
+ if (MessageFromList(a)>0L) {
+ if (MessageFromList(a) > vbuf.v_lastseen) {
+ ++num_newmsgs;
+ }
+ }
+ }
return(num_newmsgs);
}