if(id > _messageList.last()->data(0, MsgIdRole).value<MsgId>()) return _messageList.count();
// binary search
int start = 0; int end = _messageList.count()-1;
while(1) {
if(end - start == 1) return end;
int pivot = (end + start) / 2;
if(id > _messageList.last()->data(0, MsgIdRole).value<MsgId>()) return _messageList.count();
// binary search
int start = 0; int end = _messageList.count()-1;
while(1) {
if(end - start == 1) return end;
int pivot = (end + start) / 2;