1 /* $Id: LicqClient.c,v 1.11 2002/06/21 04:31:31 bluehal Exp $ */
2 /* Author : Yong-iL Joh ( tolkien@mizi.com )
3 Modified: Jorge GarcĂa ( Jorge.Garcia@uv.es )
7 * Last Updated : $Date: 2002/06/21 04:31:31 $
23 #define PCM (pc->u).mbox
25 int licqCheckHistory( /*@notnull@ */ Pop3 pc
)
29 DM(pc
, DEBUG_INFO
, ">Mailbox: '%s'\n", pc
->path
);
31 if (fileHasChanged(pc
->path
, &ut
.actime
, &PCM
.mtime
, &PCM
.size
) != 0
37 F
= openMailbox(pc
, pc
->path
);
41 while (fgets(buf
, BUF_SIZE
, F
)) {
42 if ((buf
[0] == '[') || (buf
[0] == '-')) { /* new, or old licq */
48 pc
->TotalMsgs
= count_status
* 2;
49 pc
->UnreadMsgs
= pc
->TotalMsgs
- count_status
;
50 DM(pc
, DEBUG_INFO
, "from: %d status: %d\n", pc
->TotalMsgs
,
53 /* Not clear that resetting the mtime is useful, as
54 mutt is not involved. Unfortunately, I
55 (nspring/blueHal) can't tell whether this
56 cut-and-pasted code is needed */
57 ut
.modtime
= PCM
.mtime
;
64 int licqCreate( /*@notnull@ */ Pop3 pc
, const char *str
)
66 /* LICQ format: licq:fullpathname */
71 pc
->OldUnreadMsgs
= -1;
72 pc
->checkMail
= licqCheckHistory
;
74 strcpy(pc
->path
, str
+ 5); /* cut off ``licq:'' */
76 DM(pc
, DEBUG_INFO
, "licq: str = '%s'\n", str
);
77 DM(pc
, DEBUG_INFO
, "licq: path= '%s'\n", pc
->path
);