'Used to delete messages when the remote destination acknowledges
their receipt.
Args:
destination(str): The destination server_name
up_to_stream_id(int): Where to delete messages up to.
Returns:
A deferred that resolves when the messages have been deleted.'

def delete_device_msgs_for_remote(self, destination, up_to_stream_id):

    def delete_messages_for_remote_destination_txn(txn):
        sql = 'DELETE    FROM    device_federation_outbox    WHERE    destination    =    ?    AND    stream_id    <=    ?'
        txn.execute(sql, (destination, up_to_stream_id))
    return self.runInteraction('delete_device_msgs_for_remote', delete_messages_for_remote_destination_txn)
