projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjust the folder counters when reading / deleting / moving messages
[citadel.git]
/
webcit
/
messages.c
diff --git
a/webcit/messages.c
b/webcit/messages.c
index fd886f4158ed1e503fbdecd56b5b752ee079ba3e..16293a64ca68956c5561e1e9e96c99c00a69ec05 100644
(file)
--- a/
webcit/messages.c
+++ b/
webcit/messages.c
@@
-650,10
+650,11
@@
int load_msg_ptrs(const char *servcmd,
* \param MatchMSet MSet we want to flag
* \param FlagToSet Flag to set on each BasicMsgStruct->Flags if in MSet
*/
* \param MatchMSet MSet we want to flag
* \param FlagToSet Flag to set on each BasicMsgStruct->Flags if in MSet
*/
-
void
SetFlagsFromMSet(HashList *ScanMe, MSet *MatchMSet, int FlagToSet, int Reverse)
+
long
SetFlagsFromMSet(HashList *ScanMe, MSet *MatchMSet, int FlagToSet, int Reverse)
{
const char *HashKey;
long HKLen;
{
const char *HashKey;
long HKLen;
+ long count = 0;
HashPos *at;
void *vMsg;
message_summary *Msg;
HashPos *at;
void *vMsg;
message_summary *Msg;
@@
-664,17
+665,21
@@
void SetFlagsFromMSet(HashList *ScanMe, MSet *MatchMSet, int FlagToSet, int Reve
Msg = (message_summary*) vMsg;
if (Reverse && IsInMSetList(MatchMSet, Msg->msgnum)) {
Msg->Flags = Msg->Flags | FlagToSet;
Msg = (message_summary*) vMsg;
if (Reverse && IsInMSetList(MatchMSet, Msg->msgnum)) {
Msg->Flags = Msg->Flags | FlagToSet;
+ count++;
}
else if (!Reverse && !IsInMSetList(MatchMSet, Msg->msgnum)) {
Msg->Flags = Msg->Flags | FlagToSet;
}
else if (!Reverse && !IsInMSetList(MatchMSet, Msg->msgnum)) {
Msg->Flags = Msg->Flags | FlagToSet;
+ count++;
}
}
DeleteHashPos(&at);
}
}
DeleteHashPos(&at);
+ return count;
}
}
-
void
load_seen_flags(void)
+
long
load_seen_flags(void)
{
{
+ long count = 0;
StrBuf *OldMsg;
wcsession *WCC = WC;
MSet *MatchMSet;
StrBuf *OldMsg;
wcsession *WCC = WC;
MSet *MatchMSet;
@@
-687,15
+692,16
@@
void load_seen_flags(void)
}
else {
FreeStrBuf(&OldMsg);
}
else {
FreeStrBuf(&OldMsg);
- return;
+ return
0
;
}
if (ParseMSet(&MatchMSet, OldMsg))
{
}
if (ParseMSet(&MatchMSet, OldMsg))
{
- SetFlagsFromMSet(WCC->summ, MatchMSet, MSGFLAG_READ, 0);
+
count =
SetFlagsFromMSet(WCC->summ, MatchMSet, MSGFLAG_READ, 0);
}
DeleteMSet(&MatchMSet);
FreeStrBuf(&OldMsg);
}
DeleteMSet(&MatchMSet);
FreeStrBuf(&OldMsg);
+ return count;
}
extern readloop_struct rlid[];
}
extern readloop_struct rlid[];
@@
-814,7
+820,7
@@
void readloop(long oper, eCustomRoomRenderer ForceRenderer)
Stat.startmsg = 0;
}
Stat.startmsg = 0;
}
- if (Stat.load_seen) load_seen_flags();
+ if (Stat.load_seen)
Stat.numNewmsgs =
load_seen_flags();
/*
* Print any inforation above the message list...
/*
* Print any inforation above the message list...
@@
-832,9
+838,13
@@
void readloop(long oper, eCustomRoomRenderer ForceRenderer)
Foo = NewStrBuf ();
StrBufPrintf(Foo, "%ld", Stat.nummsgs);
Foo = NewStrBuf ();
StrBufPrintf(Foo, "%ld", Stat.nummsgs);
- PutBstr(HKEY("__READLOOP:TOTALMSGS"), NewStrBufDup(Foo));
+ PutBstr(HKEY("__READLOOP:TOTALMSGS"), NewStrBufDup(Foo)); // keep Foo!
+
+ StrBufPrintf(Foo, "%ld", Stat.numNewmsgs);
+ PutBstr(HKEY("__READLOOP:NEWMSGS"), NewStrBufDup(Foo)); // keep Foo!
+
StrBufPrintf(Foo, "%ld", Stat.startmsg);
StrBufPrintf(Foo, "%ld", Stat.startmsg);
- PutBstr(HKEY("__READLOOP:STARTMSG"), Foo);
+ PutBstr(HKEY("__READLOOP:STARTMSG"), Foo);
// store Foo elsewhere, descope it here.
}
/*
}
/*