<presence /> at Berlin

By Seve

What did I do?

In short: The plan was to implement XEP-0382 in Gajim.

Gajim is a well-known XMPP client (and used by many people I know), so adding support for it made sense, right? I was lucky (very lucky) because Philipp Hörist (Gajim developer) attended as well, something decisive to get things done in a weekend. Thank you, Philipp!

At the beginning I started to look at writing it as a core feature, but Philipp warned me about Gajim going over a transition phase and my changes would not see the light until next release or so. Following his suggestion, I went for writing it as a plugin.

I must admit, it works with the current UI elements, but I’m not entirely satisfied with the result. I would like to give some thoughts to the button’s style that displays the content of the message, as well as if it would be possible to add another entry (text input) on top of the one for the message, instead of a floating element on the spoiler icon.

Letting the UI be, let’s take a look at the current parser:

# XEP-0382: Spoiler messages
def parse_spoiler(self, stanza):
    # Hardcoded namespace until nbxmpp implementation
    xml_lang = LANG
    spoiler_hint = None
    is_spoiler = False
    spoiler_elements = stanza.getTags(
        'spoiler',
        namespace='urn:xmpp:spoiler:0',
    )

    # If there's more than one spoiler element,
    # pick the one where matches with xml_lang
    if spoiler_elements:
        is_spoiler = True
        if len(spoiler_elements) == 1:
            spoiler_element = spoiler_elements[0]
        else:
            spoiler_element = stanza.getTag(
                'spoiler',
                namespace='urn:xmpp:spoiler:0',
                attrs={'xml:lang': xml_lang},
            )
        if spoiler_element:
            spoiler_hint = spoiler_element.getData()

    return is_spoiler, spoiler_hint
XEP-0382 allows for more than one <spoiler/> element in a message, using the attribute xml:lang. The decision made for this one was, if there’s more than one element, pick the hint the user can understand, using xml_lang (the client’s language). If there is no element with that language, the original hint is not displayed to the user and “Show message” is used instead (the same text as elements without hint). This is very open for discussion, because I would actually prefer to see the hint in whatever language it is. Be it because I speak more than one language and maybe one of those matches or because I could just translate it in case I would like to. Other people just find it confusing to display text in a language the application is not being displayed on (which is something easy to agree with), or even feel uncomfortable reading other alphabets that are not the one they know. And being honest, this would be used mainly by people speaking the same language, so this kind of problem should be marginal.
Nevertheless, working on this helped me to think a bit on the feature and if the specification needed changes before moving towards Draft.

I didn’t know much about the project internals, and even though the basic feature is done, there are some things that I will try to include eventually. For example,

  • I would have liked to toggle the spoiler on and off instead of revealing it until the chat window is reopened again.
  • Embedded images do not work (it makes me very sad). It is a separate plugin and I still need to check if it is even possible with the current implementation.
  • Link formatting. Currently transforming text into a clickable link does not work if it is inside a spoiler.
  • Popup notifications display the content of the message (they should not)

Currently, Gajim uses a TextView for the conversation window, which makes this kind of tweaks a bit more tedious than they could be if some other solution was used. But hopefully, we will get there! :)

I will keep improving the plugin and making sure it is maintained, so reach to me to pull my ears if that’s not the case!

The experience

Well, what can I say? Meeting with people you chat (almost) daily many times with and share similar values as yours is always a fantastic feeling. Surprisingly, there were many locals attending the event, also members of the XMPP Berlin Meetup, so I recommend you to check it out if you are near Berlin.

Xavi and I stayed very close to Rummelsburg station, where one can spot an interesting façade.

Rummelsbrug station

I just had to take a picture of it, I don’t usually see buildings that fake they are falling apart :)

The venue was at Deutscher Bundesjugendring (DBJR)’s, the umbrella of German youth organisations.

We had free food and drinks, a luxury I didn’t expect at all! Amazing breakfast with painted eggs It was funny to see painted (and boiled) eggs, because even though I may have painted them as a child at school, it is not something I usually do.

Regarding the drinks, I finally tasted the drink for hackers:

Club-Mate drink

I cannot lie, we had lots of it, and I know now why people choose it for hacking. It sure boosts you up. I have already looked up where to buy it in Copenhagen!

From an organizational point, the event was a complete success, there was enough space for everybody, we had meetings gathering together to report how things were going on (kind of like stand-ups) and of course we did go out for dinner!
We even got a coffee cup courtesy of DBJR, wishing us a safe trip back home. Couldn’t complain at all.