Commit graph

460 commits

Author SHA1 Message Date
Daniel Gultsch 6155938623 show reason in error message 2019-10-05 22:14:38 +02:00
Daniel Gultsch d6835101b9 fixes for previous commit 2019-10-05 21:58:21 +02:00
Daniel Gultsch 7ce7a505a0 mark cancelled jingle ft as such on both sides
fixes #3554
2019-10-05 21:30:15 +02:00
Daniel Gultsch 6776603b90 fully read port in socks connection
incoming direct connections in receive mode wouldn’t clear the entire
destination from the input stream; thus adding a leading 0x00 to the file

fixes #3557
2019-10-03 20:47:31 +02:00
Daniel Gultsch 3d332f6f35 set shorter timeouts when using direct candidates 2019-10-03 09:37:01 +02:00
Daniel Gultsch f8bd4284a5 report not-acceptable on jingle errors 2019-10-01 11:31:15 +02:00
Daniel Gultsch d2d9bbe3da improved jingle debugging 2019-09-29 13:32:45 +02:00
Daniel Gultsch ed46d12115 close correct socket after faulty jingle socks connection 2019-09-20 10:00:57 +02:00
Daniel Gultsch 9bf5fb98ac show language in message bubble if multiple language variants were received
XML and by inheritence XMPP has the feature of transmitting multiple language
variants for the same content. This can be really useful if, for example, you
are talking to an automated system. A chat bot could greet you in your own
language.

On the wire this will usually look like this:

```xml
<message to="you">
  <body>Good morning</body>
  <body xml:lang="de">Guten Morgen</body>
</message>
```

However receiving such a message in a group chat can be very confusing and
potentially dangerous if the sender puts conflicting information in there and
different people get shown different strings.

Disabeling support for localization entirely isn’t an ideal solution as on
principle it is still a good feature; and other clients might still show a
localization even if Conversations would always show the default language.

So instead Conversations now shows the displayed language in a corner of the
message bubble if more than one translation has been received.

If multiple languages are received Conversations will attempt to find one in
the language the operating system is set to. If no such translation can be
found it will attempt to display the English string.

If English can not be found either (for example a message that only has ru and
fr on a phone that is set to de) it will display what ever language came first.

Furthermore Conversations will discard (not show at all) messages with with
multiple bodies of the same language. (This is considered an invalid message)

The lanuage tag will not be shown if Conversations received a single body in
a language not understood by the user. (For example operating system set to
'de' and message received with one body in 'ru' will just display that body as
usual.)

As a guide line to the user: If you are reading a message where it is important
that this message is not interpreted differently by different people (like a
vote (+1 / -1) in a chat room) make sure it has *no* language tag.
2019-09-12 10:12:51 +02:00
Daniel Gultsch dd9777a6b7 do not include scope in ipv6 annoucment 2019-09-08 17:44:26 +02:00
Daniel Gultsch 9129c9acde JET uses plain text file size 2019-09-06 13:11:37 +02:00
Daniel Gultsch 0e1c26c569 do not include link local in direct candidates 2019-09-05 13:17:45 +02:00
Daniel Gultsch 571c29f92a make Tor connections work with direct TLS 2019-09-05 12:08:58 +02:00
Daniel Gultsch 7ec1b443ab implemented support for for jingle encrypted transports (XEP-0396) 2019-09-04 16:14:01 +02:00
Daniel Gultsch ff4d127b6f use higher priority for proxy on receiving end 2019-09-02 08:51:50 +02:00
Daniel Gultsch 90e669313e send fallback to ibb after proxy activation failed 2019-09-01 21:41:28 +02:00
Daniel Gultsch 10b1365264 also reply with direct connections on response 2019-09-01 20:42:07 +02:00
Daniel Gultsch 1c413edf06 bare minimum direct connections 2019-09-01 15:06:59 +02:00
Daniel Gultsch 783ed53d3a order canditates by priority before attempting to connect 2019-09-01 11:34:36 +02:00
Daniel Gultsch 219ae65ef7 more ibb fixes (include sid in transport-accept) 2019-08-22 14:47:30 +02:00
Daniel Gultsch 98eb49904c fixed unlikely race between enabling carbons and discovering last MAM id 2019-08-22 09:57:39 +02:00
Daniel Gultsch daf7e6224f fixed pgp decryption of automatically accepted jingle ft 2019-08-16 15:29:58 +02:00
Daniel Gultsch d3ccba445a increased reconnection interval after policy violation 2019-08-16 15:00:26 +02:00
Daniel Gultsch 0770914edf refactored filename and extension parsing 2019-08-16 14:09:42 +02:00
Daniel Gultsch c039ffcf35 clean up logging 2019-08-14 18:44:57 +02:00
Daniel Gultsch ed95dd64ad create empty disco result on error to fire advance stream features event 2019-08-13 21:18:32 +02:00
Daniel Gultsch 8ac042418b fixes #3514 2019-08-11 16:54:00 +02:00
Daniel Gultsch 98c4e9056f use helper method to close socket 2019-07-04 10:12:08 +02:00
Daniel Gultsch e467fe341e implement client support for muc push
Staying connected to a MUC room hosted on a remote server can be challenging.

If a server reboots it will usually send a shut down notification to all
participants. However even if a client knows that a server was shut down it
doesn’t know when it comes up again. In some corner cases that shut down
notification might not even be delivered successfully leaving the client in a
state where it thinks it is connected but it really isn’t.

The possible work around implemented in this commit is to register the clients
full JID (user@domain.tld/Conversations.r4nd) as an App Server according to
XEP-0357 with the room. (Conversations checks for the push:0 namespace on the
room.)

After cycling through a reboot the first message send to a room will trigger
pubsub notifications to each registered full JID. This event will be used to
trigger a XEP-0410 ping and if necessary a subsequent rejoin of the MUC.

If the resource has become unavailable during down time of the MUC server the
user’s server will respond with an IQ error which in turn leads to the MUC
server disabling that push target.

Leaving a MUC will send a `disable` command. If sending that disable command
failed for some reason (network outage) and the client receives a pubsub
notification for a room it is no longer joined in it will respond with an
item-not-found IQ error which also disables subsequent pushes from the server.

Note: We 0410-ping before a join to avoid unnecessary full joins which can be
quite costly. Further client side optimazations will also surpress pings when
a ping is already in flight to further save traffic.
2019-06-24 18:16:06 +02:00
Daniel Gultsch 6862b60c3f self ping (xep-0410) after receiving invite to muc 2019-06-18 13:20:24 +02:00
Daniel Gultsch 782d889cc5 disallow subsequent session-accept 2019-06-17 09:51:49 +02:00
Daniel Gultsch 9fc1ead74f use ibb if other party doesn’t annouce s5b feature 2019-06-16 22:57:10 +02:00
Daniel Gultsch fe6c981ae2 accept direct ibb jingle offers 2019-06-16 21:23:18 +02:00
Daniel Gultsch c965049605 handle invalid canditates in jingle 2019-05-22 17:30:51 +02:00
Daniel Gultsch 61604dedea jingle: send canditate error before fallback 2019-04-30 11:23:15 +02:00
af8a524db1 137d48810d Make use of Namespace.REGISTER constant (#3446) 2019-04-29 07:51:46 +00:00
Daniel Gultsch bebce313b2 print available stream features / mechanisms on incompat server 2019-02-09 20:21:29 +01:00
Daniel Gultsch 18807305c1 do not require starttls when connecting over to .onion domain 2019-01-25 08:48:46 +01:00
Daniel Gultsch 83c3258dd7 properly jump out of connection loop on state changing errors 2019-01-19 11:47:21 +01:00
Daniel Gultsch a53774bc6d resend presence to muc avatar update. fixes #3175 2019-01-17 17:55:47 +01:00
Daniel Gultsch e9bf2b464c explicitly set type=images for all media with an image mime type
this is in preperation to be able to query the database for all images
2019-01-12 09:01:35 +01:00
Daniel Gultsch 96e3546904 put images into MessageStyle notifications 2019-01-09 12:47:09 +01:00
Daniel Gultsch 6b75c819d8 log number of unhandled iq callbacks after resume 2018-12-22 13:00:40 +01:00
Daniel Gultsch 9659f46136 log policy violation stream error message to logcat 2018-12-18 11:02:25 +01:00
Daniel Gultsch 7219f42ad2 check mam preference for mam:2 namespace and purge offline only if set 2018-12-05 19:11:40 +01:00
Daniel Gultsch 1de385dcb9 set access model to open when publishing avatar. fixes #3291 2018-11-25 20:58:48 +01:00
Daniel Gultsch 5f8184fe8e only store non hardcoded resolver result in db 2018-10-16 12:23:27 +02:00
Daniel Gultsch 57fe153ef1 make 'cancelled' work for jingle ft 2018-10-08 10:31:41 +02:00
Daniel Gultsch 390175e5b3 use short read timeout when waiting for first stream open. disable read timeout aftwards 2018-10-04 11:20:02 +02:00
Daniel Gultsch f608fb349a refactored file encryption to give access to inner stream
Conscrypt on some plattforms doesn’t like when we close the CipherInputStream. Therefor we refactor the api to give us access to the inner stream so we can close that independently.
2018-10-03 18:14:45 +02:00