Exemplo n.º 1
0
    def _request(cls, user, request, hook, *args, **kwargs):
        combined = []

        ms = MessageService(redis=cls._redis())
        handler = cls.handle_request(user, request, hook, *args, **kwargs)
        for message in handler:
            combined.append(message)
            for channel in hook.project.channels:
                ms.send_message(message, channel)

        if hook.project.public:
            ms.log_message('\n'.join(combined), hook.project)
Exemplo n.º 2
0
    def _request(cls, user, request, hook, *args, **kwargs):
        combined = []

        ms = MessageService(redis=cls._redis())
        handler = cls.handle_request(user, request, hook, *args, **kwargs)

        if handler is None:
            # It's entirely possible for a message body to be a NOP,
            # so don't do anything at all.
            return

        for message in handler:
            combined.append(message)
            for channel in hook.project.channels:
                ms.send_message(message, channel)

        if hook.project.public:
            ms.log_message('\n'.join(combined), hook.project)