• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • jabber-plugin
    • None

      When getting notified by the jenkins bot in a jabber chat room (MUC), it's not always easy to find out if something broke or not.
      Surely FIXED and FAILED are written in uppercase, but that is not readable in every case.

      It'd be nice if XMPP HTML messages would be sent additional to the normal plain text messages, with FIXED and FAILED being bold and colored green/red.

          [JENKINS-10742] Send HTML jabber messages

          kutzi added a comment -

          kutzi added a comment - Note to self: http://xmpp.org/extensions/xep-0071.html#discovery

          Thomas Keller added a comment -

          I'd be interested picking this up - from what I've seen so far it won't be easy, though, since the IMChat interface from the instant messaging plugin, which is also implemented in the Jabber plugin, has a general sendMessage(String) method, which means that a possible refactoring probably affects all depending plugins, right?

          What would be a good starting point?

          Thomas Keller added a comment - I'd be interested picking this up - from what I've seen so far it won't be easy, though, since the IMChat interface from the instant messaging plugin, which is also implemented in the Jabber plugin, has a general sendMessage(String) method, which means that a possible refactoring probably affects all depending plugins, right? What would be a good starting point?

          kutzi added a comment -

          Thomas,
          it's really a difficult question on how to approach this issue.
          Not only the IMChat interface would have needed to be changed, but also all BotCommands, the BuildToChatNotifiers and possibly more.
          You could introduce a sub-interface of IMChat which accepts additionally a rich-text message in addition to the string message.
          But the rich-text format would be dependend on the concrete implementation (RT messages in Jabber look probably totally different than those in IRC). So no real solution IMO.

          kutzi added a comment - Thomas, it's really a difficult question on how to approach this issue. Not only the IMChat interface would have needed to be changed, but also all BotCommands, the BuildToChatNotifiers and possibly more. You could introduce a sub-interface of IMChat which accepts additionally a rich-text message in addition to the string message. But the rich-text format would be dependend on the concrete implementation (RT messages in Jabber look probably totally different than those in IRC). So no real solution IMO.

          kutzi added a comment -

          The only idea I've got currently would be a complete separation of model and view.
          I.e. the BotCommands would only return the model for the messages and the concrete implementations would decide on how to render this

          kutzi added a comment - The only idea I've got currently would be a complete separation of model and view. I.e. the BotCommands would only return the model for the messages and the concrete implementations would decide on how to render this

          Thomas Keller added a comment -

          I dived a little deeper into this and I can see what you mean there. I'd say a clean implementation would use Jelly or some other kind of templating system to store a template for each notification / bot command result, possibly even localized. And I suspect this task comes near a complete rewrite of the plugins as they are now. My problem is that my time is rather limited and that I'd have a big ramp-up time for such a project (knowing almost nothing about Jenkins internals nor the Jelly template engine), so its impossible for me to do alone.

          Hell, since I only want to make Jabber messages appear in a friendlier way I suppose I'd be even faster by forking both plugins, pulling the common, needed stuff from the messaging into the jabber plugin and hacking plain-text and XHTML messages for the various publishing / bot tasks into that, but I suppose this would lead to an unmaintainable blob of crap.

          Thomas Keller added a comment - I dived a little deeper into this and I can see what you mean there. I'd say a clean implementation would use Jelly or some other kind of templating system to store a template for each notification / bot command result, possibly even localized. And I suspect this task comes near a complete rewrite of the plugins as they are now. My problem is that my time is rather limited and that I'd have a big ramp-up time for such a project (knowing almost nothing about Jenkins internals nor the Jelly template engine), so its impossible for me to do alone. Hell, since I only want to make Jabber messages appear in a friendlier way I suppose I'd be even faster by forking both plugins, pulling the common, needed stuff from the messaging into the jabber plugin and hacking plain-text and XHTML messages for the various publishing / bot tasks into that, but I suppose this would lead to an unmaintainable blob of crap.

          kutzi added a comment -

          Maybe we could start as a 1st step and change the BotCommands to return the current plain-text messages and the model data.
          Would still mean lot of changes in the Jabber plugin (fork), but at least a bit code reuse.

          In regards to templating: do yourself a favor and use something different than Jelly (e.g. Freemarker).
          Surely, Jelly is in widespread use in Jenkins, but it's a pita to use IMHO.

          kutzi added a comment - Maybe we could start as a 1st step and change the BotCommands to return the current plain-text messages and the model data. Would still mean lot of changes in the Jabber plugin (fork), but at least a bit code reuse. In regards to templating: do yourself a favor and use something different than Jelly (e.g. Freemarker). Surely, Jelly is in widespread use in Jenkins, but it's a pita to use IMHO.

            kutzi kutzi
            cweiske_nr Christian Weiske
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: