- if ((d = Ustrncmp(a->text, b->text, 6)) == 0)
- d = Ustrcmp(a->text + 14, b->text + 14);
+ if ((d = Ustrncmp(a->text, b->text, MESSAGE_ID_TIME_LEN)) == 0)
+ {
+ BOOL a_old = is_old_message_id(a->text), b_old = is_old_message_id(b->text);
+ /* Do not worry over the sub-second sorting wrt. old vs. new */
+ d = Ustrcmp(a->text + (a_old ? 6+1+6+1 : MESSAGE_ID_TIME_LEN + 1 + MESSAGE_ID_PID_LEN + 1),
+ b->text + (b_old ? 6+1+6+1 : MESSAGE_ID_TIME_LEN + 1 + MESSAGE_ID_PID_LEN + 1));
+ }