Community-edition: [services request] Threema Web

Created on 15 Feb 2017  路  23Comments  路  Source: ramboxapp/community-edition

As Threema just announced it's Web services (https://web.threema.ch/), it would nice to have it integrated in Rambox aswell.

new service

Most helpful comment

:+1: finally Threema web is available. I'll provide a PR soon!

All 23 comments

If you currently add it as a custom service, it will not entirely load the chats (stuck at 99 or 100 %). If you then reload the service, it has been reset entirely and you need to reconnect it entirely.

:+1: finally Threema web is available. I'll provide a PR soon!

If you currently add it as a custom service, it will not entirely load the chats (stuck at 99 or 100 %). If you then reload the service, it has been reset entirely and you need to reconnect it entirely.

Are you sure? Just added it as an custom service + JavaScript as mentioned in the wiki. Loads fine.

Haven't received a message until now, so can't say about the unread badge, though.

It worked for me as well. Unread batch worked out of the box.

You are right. Now it works for me too. Without any changes.
Maybe I just had a poor connection on my phone.

I like the feature with the password, so you can connect without rescanning, but it's kind of annoying to have to reenter it every time you reload or restart Rambox...

Are you sure? Just added it as an custom service + JavaScript as mentioned in the wiki. Loads fine.

@Trollwut: What JavaScript are you talking about exactly?

I think there should just be some hint that it needs a password, if the service is reloaded. For example when starting the app and I don't think abuot it, the tab should be named like "Service Name [needs auth!]" so that I know why I don't get message notifications. :>

@SimJoSt Eat this!

@SimJoSt Eat this!

Thank you. It was delicious.
But badges worked for me without injection of custom code.

But badges worked for me without injection of custom code.

Thanks. Then I'll delete the custom JS, as it isn't necessary. :>

I noticed, that upon a disconnect, Threema shows an information about the disconnect. In this state, there is no possibility to reconnect the session. A reload of the page is necessary.
For an official integration into Rambox, there should be a system in place which recognizes this state and automatically reloads the page, as there is no obvious reload button and we cannot depend on simple users to find the reload functionality.

@SimJoSt I played around and found:

  • when deactivating it in the app it goes back to the bar code page
  • when the app looses connection it says "reconnecting" - after a while it goes back to the bar code page
  • starting rambox not having the app read goes to the bar code page

Can you explain your problem a bit more in detail and with reproduction steps please?

All others here: you can grab the JavaScript code from the PR #698.

The "disconnected" page @SimJoSt is writing about is shown if the connection to the signaling server is unexpectedly closed. That can happen e.g. if reconnecting fails 3 times (although it's probably a bug in the reconnecting procedure that will be fixed in the next days or weeks).

Adding a reload button would be a simple workaround. Feel free to open an issue, or if you want it fixed a bit faster, create a pull request.

@dbrgn do you know how I can get to the "disconnected" page?
Since I'm adding the service to rambox I can add a reload function to the JavaScript.
But I need to see the page once.

Easiest way is probably to go to https://web.threema.ch/ and then to disconnect the network connection.

But you need to be careful not to cause inifinite reload loops.

Here you go (German version):
2017-02-19 16_36_09-rambox

Fehler: Server-Verbindung wurde geschlossen.
Bitte laden Sie die Seite neu.

Translation:

Error; Server connection was closed.
Please reload the page.

I just put my phone in airplane mode and waited for it to decide it was disconnected^^
The page doesn't go back to the barcode or the password input form.

_What is you JavaScript doing, as Threema worked out of the box as a custom services for me? Or is it the standard JavaScript code which is used for all (custom) services?_

I now add a "reload" button when Threema reports an error; PR updated.

@SimJoSt The code gets the unread count from the service. It works somehow out of the box by luck, because Threema writes the unread count into the browser window title. But it doesn't work for example if you already have new messages on startup. The JavaScript code there works more reliable.

screenshot from 2017-02-19 17-19-00

As you apparently can recognize when there is an error, so it would be possible to reload automatically.
The downside of this, some users might be confused, why the services has disconnected.

An alternative fix would be to show a little information after an automatically reload, that the connection was lost instead of showing the manual reload button. I have no strong opinion on this, but wanted to present the possibility.

The reload button just landed in master: https://github.com/threema-ch/threema-web It's better to do it in the actual Threema Web code instead of injecting custom JS.

Automatic reload might follow in a future version.

That's so cool @dbrgn! I didn't know we had people here, who are directly at the source.
Now @weeman1337 can revert back to the version without the button, as I expect Threema Web will publish a new release in the near future.

I didn't know we had people here, who are directly at the source.

Since the code is open source we also accept pull requests :)

I reverted adding the reload button

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings