~robru/friends/facebook-stories

« back to all changes in this revision

Viewing changes to friends/protocols/facebook.py

  • Committer: Robert Bruce Park
  • Date: 2013-03-11 22:40:10 UTC
  • Revision ID: robert.park@canonical.com-20130311224010-fihmrn0ndgdqlhrm
Give up on the idea of deduplication across protocols.

We used to have a *ton* of corner case logic that attempted to merge
messages that had the same content, but were from distinct social
networks. That made some sense back in the old gwibber days but it's
becoming an increasingly irrelevant corner case that is needlessly
complicating a lot of our application logic.

This commit removes that logic, and also greatly simplifies the model
schema accordingly, allowing for much easier filtering and sorting of
the model by it's consumers (such as qml-friends).

There's a big impact on the test suites, as this changes *huge*
portions of our fundamental architectural assumptions. In the process
of updating it, I also discovered that Base._unpublish_all was
poorly/indirectly tested, so I wrote some better, explicit tests for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
            return
61
61
 
62
62
        args = dict(
 
63
            message_id=message_id,
63
64
            stream=stream,
64
65
            message=entry.get('message', ''),
65
66
            icon_uri=entry.get('icon', ''),
92
93
            args['timestamp'] = iso8601utc(parsetime(timestamp))
93
94
 
94
95
        # Publish this message into the SharedModel.
95
 
        self._publish(message_id, **args)
 
96
        self._publish(**args)
96
97
 
97
98
        # If there are any replies, publish them as well.
98
99
        for comment in entry.get('comments', {}).get('data', []):