'Get all the push rules changes that have happend on the server'

def get_all_push_rule_updates(self, last_id, current_id, limit):

    if (last_id == current_id):
        return defer.succeed([])
    def get_all_push_rule_updates_txn(txn):
        sql = 'SELECT    stream_id,    event_stream_ordering,    user_id,    rule_id,    op,    priority_class,    priority,    conditions,    actions    FROM    push_rules_stream    WHERE    ?    <    stream_id    AND    stream_id    <=    ?    ORDER    BY    stream_id    ASC    LIMIT    ?'
        txn.execute(sql, (last_id, current_id, limit))
        return txn.fetchall()
    return self.runInteraction('get_all_push_rule_updates', get_all_push_rule_updates_txn)
