Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Push badge counts #507

Merged
merged 10 commits into from Jan 21, 2016
Merged

Push badge counts #507

merged 10 commits into from Jan 21, 2016

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Jan 19, 2016

Fixes the 'push notification badge count' part of https://github.com/vector-im/vector-web/issues/469

sync_handler = self.hs.get_handlers().sync_handler
_, ephemeral_by_room = yield sync_handler.ephemeral_by_room(
sync_config, now_token
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than abusing SyncConfig it'd probably be cleaner to add a storage function get_receipts_for_room, e.g.:

    @cached(num_args=3)
    def get_receipts_for_room_for_room(self, room_id, user_id, receipt_type):
        return self._simple_select_list(
            table="receipts_linearized",
            keyvalues={
                "room_id": room_id,
                "receipt_type": receipt_type,
                "user_id": user_id,
            },
            retcols=("event_id"),
            desc="get_receipts_for_room",
        )

or possibly using _simple_select_one_onecol

@dbkr
Copy link
Member Author

dbkr commented Jan 20, 2016

ptal, at least for the bits you didn't help me write. Have added the index on user_id to receipts_linearized too.

@erikjohnston
Copy link
Member

Other than unindenting update_pusher_last_token, LGTM

dbkr added a commit that referenced this pull request Jan 21, 2016
@dbkr dbkr merged commit c1a3021 into develop Jan 21, 2016
@richvdh richvdh deleted the push_badge_counts branch December 1, 2016 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants