code: def mark_all_as_read(self, recipient=None):
          
          # We want to filter out read ones, as later we will store
          # the time they were marked as read.
          qset = self.unread(True)
          if recipient:
              qset = qset.filter(recipient=recipient)
  
          return qset.update(unread=False)
docs: Mark as read any unread messages in the current queryset.
  
          Optionally, filter these by recipient first.