def METHOD_NAME(self, sender, rapidpro_message_id, text, quick_replies):
    # Messages sent from User to RapidPro server don't have rapidpro_message_id
    from_rapidpro_server = bool(rapidpro_message_id)
    if from_rapidpro_server:
        message, created = Message.objects.get_or_create(rapidpro_message_id=rapidpro_message_id, defaults={
            'sender': sender,
            'text': text,
            'quick_replies': quick_replies,
            'thread': self.thread,
        })
        if not created:
            # If the message already exists, we concatenate the newly received
            # messages with the existing message. An assumption here is that
            # messages will always be received in the correct order. This should
            # be confirmed with RapidPro
            message.text = f'{message.text}{text}'
            message.save(update_fields=['text'])
        else:
            payload = {
                'head': 'New Message!',
                'body': 'Click here to view it.',
                'url': self.thread.get_absolute_url(),
            }
            for user in self.thread.users.all():
                try:
                    send_user_notification(user=user, payload=payload, ttl=1000)
                except Exception as e:
                    logger.exception(e)
    else:
        Message.objects.create(
            rapidpro_message_id=rapidpro_message_id, sender=sender, text=text, thread=self.thread,
            quick_replies=quick_replies)
    self.thread.last_message_at = timezone.now()
    self.thread.save(update_fields=['last_message_at'])