@classmethod
def get_user_thread(cls, request, thread_id, user, return_default=False):
    """Gets user thread while creating pool if necessary."""
    request = cls._extract_django_request(request)
    user_threads_pool = cls._get_user_threads_pool(request, thread_id)
    if user.pk in user_threads_pool:
        return user_threads_pool[user.pk]
    elif return_default:
        from chat_api.chat.models import UserThread
        thread = cls.get_thread(request, thread_id)
        return UserThread(user=user, thread=thread, created=thread.created,
            updated=thread.updated, notifications=0, permissions=UserThread
            .PERMISSION_MESSAGES_READ | UserThread.PERMISSION_THREAD_READ,
            state=UserThread.STATE_CLOSED, last_message=thread.last_message)
    return None
