~ubuntu-branches/ubuntu/utopic/kadu/utopic

« back to all changes in this revision

Viewing changes to kadu-core/message/sorted-messages.cpp

  • Committer: Package Import Robot
  • Author(s): Patryk Cisek
  • Date: 2014-10-02 11:55:19 UTC
  • mfrom: (0.48.1) (0.44.2) (43.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20141002115519-sxn21g16t596llc0
Tags: 1.0-2
* Using dpkg-buildflags to set compilation and linker flags.
* Added 03-no-CMAKE_CXX_FLAGS-overwrite.patch to make it possible to set
  compilation flags.
* Removed lintian override for RPATH in Kadu's plugins.
* Using chrpath to strip Kadu's plugins from RPATH, since they're not
  needed there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * %kadu copyright begin%
 
3
 * Copyright 2014 Michał Ziąbkowski (mziab@o2.pl)
3
4
 * Copyright 2014 Rafał Malinowski (rafal.przemyslaw.malinowski@gmail.com)
4
5
 * %kadu copyright end%
5
6
 *
27
28
        if (left == right)
28
29
                return false;
29
30
 
 
31
        if (left.isNull() && !right.isNull())
 
32
                return true;
 
33
 
 
34
        if (!left.isNull() && right.isNull())
 
35
                return true;
 
36
 
30
37
        if (left.receiveDate() < right.receiveDate())
31
38
                return true;
32
39
 
33
 
        return false;
 
40
        if (left.receiveDate() > right.receiveDate())
 
41
                return false;
 
42
 
 
43
        return left.content() < right.content();
34
44
}
35
45
 
36
46
bool SortedMessages::same(const Message &left, const Message &right)
44
54
        if (left.type() != right.type())
45
55
                return false;
46
56
 
47
 
        // In our SQL history we store datetime with accuracy to one second,
48
 
        // while for received XMPP messages we have a millisecond accuracy.
49
 
        // So to have proper results, we need to truncate those additional milliseconds.
50
 
        if (left.receiveDate().toTime_t() != right.receiveDate().toTime_t())
 
57
        if (left.receiveDate() != right.receiveDate())
51
58
                return false;
52
59
 
53
60
        if (left.messageChat() != right.messageChat())