if (Stat.sortit) {
CompareFunc SortIt;
memset(&SubTP, 0, sizeof(WCTemplputParams));
- SubTP.Filter.ContextType = CTX_NONE;
+ SubTP.Filter.ContextType = CTX_MAILSUM;
SubTP.Context = NULL;
SortIt = RetrieveSort(&SubTP, NULL, 0,
HKEY("date"), Stat.defaultsortorder);
NewSort->Reverse = Reverse;
NewSort->GroupChange = GroupChange;
NewSort->ContextType = ContextType;
+ if (ContextType == CTX_NONE) {
+ lprintf(1, "sorting requires a context. CTX_NONE won't make it.\n");
+ exit(1);
+ }
+
Put(SortHash, name, len, NewSort, DestroySortStruct);
}
}
SortBy = (SortStruct*)vSortBy;
+ if (SortBy->ContextType != TP->Filter.ContextType)
+ return NULL;
+
/** Ok, its us, lets see in which direction we should sort... */
if (havebstr("SortOrder")) {
SortOrder = LBSTR("SortOrder");