Commit graph

178 commits

Author SHA1 Message Date
Philipp Hörist
117036b872 Init Roster after stream management resume
nbxmpp deletes the roster object on disconnect. Init the roster from db
again on resume.

Fixes #8296
2018-05-18 18:20:30 +02:00
Philipp Hörist
6ed04e2dd2 Simplify generating random int
No need to use SystemRandom() here, as this is not needed for security
purposes
2018-05-17 21:13:37 +02:00
Philipp Hörist
4731e8491b Move signal code into gajim.py
The reason for signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Python ignores SIGPIPE by default ( signal(SIGPIPE, SIG_IGN) )
Write on a socket return then an error 32 EPIPE, which naturally
turns into an exception.

signal.SIG_DFL restores normal UNIX behavior
2018-05-17 20:59:22 +02:00
Philipp Hörist
72df2524e9 Remove check_X509
We dont need this module anymore
2018-05-17 20:12:02 +02:00
Philipp Hörist
2a8c0da367 Use i18n module to determine locale 2018-05-17 20:01:59 +02:00
Philipp Hörist
40aa3d808b Remove unused comments
The attributes were removed in 8e09fd92
2018-05-17 20:01:59 +02:00
Andrey Gursky
4f29e2b353 Preserve SSL handshake errors order
Sets are unordered and list with push/pop acts as LIFO, though we need FIFO.
Since the number of elements is tiny, no need to use deque.

Addresses #9120
2018-05-16 19:50:21 +02:00
Philipp Hörist
8b9eb59ee4 Set no-store hint on groupchat chatstates 2018-05-07 18:04:24 +02:00
Philipp Hörist
bcf27cb3c1 Support for PKIX over Secure HTTP (POSH)
Fixes #9083
2018-05-01 21:08:26 +02:00
Philipp Hörist
c534d3a147 Refactor SSL errors
Dont save fingerprints to config and check certs with our own methods.
We should trust openssl to do all necessary checks.

Self signed certs can be added to cacert.pem and will not show up as
an error until the cert changes.

nbxmpp now saves all ssl errors and passes them, so now we loop over
all errors until all are confirmed or ignored by the user

Also cacerts are now saved in utf-8
2018-05-01 14:03:20 +02:00
Philipp Hörist
56a5d01609 Dont allow plain BOSH by default 2018-04-29 23:34:46 +02:00
Philipp Hörist
105427b8fd Use consistent way to get paths
This lets us now import the app module without setting paths
2018-04-25 20:49:37 +02:00
Philipp Hörist
e265514d88 Detect dependencys only on demand
This allows us to import the app module without triggering
dependency detection

Also add is_installed() for checking if a dependency is installed and
disable_dependency() in case we dont want to use a dependency
2018-04-24 19:36:33 +02:00
Philipp Hörist
986898f69d Dont check for OpenSSL we require it on install 2018-04-23 23:47:17 +02:00
Yann Leboulanger
c2184aaf8c remove bookmark and close muc when destroying the room. Fixes #8862 2018-03-29 11:01:25 +02:00
Yann Leboulanger
f52e8d889c don't traceback on account deletion. Fixes #8960 2018-03-28 11:36:14 +02:00
Philipp Hörist
0fb19c2b1c Show error message on account registration
Prefer the error message text over the error code
2018-03-24 17:55:32 +01:00
Philipp Hörist
4e1a9db6cc Remove conditional code for nbxmpp < 0.6.3 2018-03-24 00:19:27 +01:00
Philipp Hörist
b3e6170e57 Remove cacert.pem
Dont ship cacerts, use certifi on Windows
2018-03-24 00:17:34 +01:00
Sebastian Wagner
e740d12727 Defer txt record lookup until connection attempt
Don't try to resolve _xmppconnect records for servers before trying to connect.
Prevent warnings from gajim.c.resolver for accounts with "connect on startup" disabled.
2018-03-05 22:55:25 +01:00
Philipp Hörist
c6e39309cf Use MessageSentEvent to print to ChatControl
Its later than StanzaMessageOutgoingEvent, this allows encryption
Plugins to not return the encrypted payload immediatly.
For example encrypting may take some time because a password is needed
or the load has to be encrypted in another Thread.
2018-02-26 20:49:01 +01:00
Philipp Hörist
1fbc6a2304 Tag MUC PMs
This gives the server the chance to react accordingly without applying
much logic.
Also it makes it easier for us to recognize MUC PMs in MAM querys
2018-02-21 23:09:30 +01:00
Philipp Hörist
36f23c9cf2 Update httpupload action on discovery 2018-01-27 10:55:25 +01:00
Bronko
3a3be94aa8 integrate httpupload plugin into gajim core
add new config option 'filetransfer_preference'
add drag and drop support for file upload
2018-01-22 17:29:27 +01:00
Philipp Hörist
32e873e6eb Add ALPN Support 2018-01-03 22:11:42 +01:00
Marc Schink
8e09fd9272 Add support for XEP-0368
- Use xmpps-client SRV records
 - Use separate host entry per connection type
 - Replace 'connection_types' with 'allow_plaintext_connection' option
2017-12-20 18:38:01 +01:00
Apromixately
b8fe0e20c3 Remove incorrect assert
When a ping reply is received there is probably a connection. Anyway, the
last ping might have been lost and the ids might not match up.
2017-12-16 16:23:44 +01:00
Philipp Hörist
f8ddefb6da Fix var reference 2017-12-10 22:56:20 +01:00
Philipp Hörist
7815ce19a5 Dont use callbacks when sending messages
Using a callback to display a sent message inside the ChatControl means
that all messages we send have to be issued from the GUI layer
(send_message()) if we want them to display in the ChatControl.

This replaces the callback and catches the stanza-message-outgoing event
after it was processed by the core.

This is easier to read/understand than dealing with callbacks and lets
the core issue messages without having to care if a ChatControl is open or not
2017-12-10 18:56:29 +01:00
Philipp Hörist
786ef96400 Port InformationEvent handling to new interface 2017-12-09 00:15:26 +01:00
Yann Leboulanger
086eeb3dc8 resolve TXT record only for non-zeroconf accounts. Fixes #8792 2017-12-03 14:55:41 +01:00
Yann Leboulanger
46711e1107 Merge branch 'XEP-156' into 'master'
implement XEP-0156

Closes #5795

See merge request gajim/gajim!154
2017-11-29 14:25:49 +01:00
Yann Leboulanger
149edfe3ef implement XEP-0156. Fixes #5795 2017-11-20 21:31:29 +01:00
Philipp Hörist
1c895e8983 Persist resource across sessions
This was somehow lost once we implemented random resource strings
Although its good that initally a random resource is chosen, it
still should persist across sessions.

This helps to kill zombie client connections on the server because
most servers kill the old session once a new with the same resource
connects

Also dont notify the user about resource conflicts if no custom
resource is set. We should not expect users to know about resources
and what they are used for as long as possible.
2017-11-20 18:10:51 +01:00
Philipp Hörist
95357361bf Save account_id in logs table 2017-11-19 19:36:25 +01:00
Philipp Hörist
536a504f69 Remove Support for mam:0 2017-11-19 19:36:25 +01:00
Philipp Hörist
75b1d54b4c Add MAM for MUCs 2017-11-19 19:36:20 +01:00
Philipp Hörist
8c8b491846 ServerInfo: Show if features are disabled by user
- Show new Symbol if a feature is available but not enabled
- Add this info to the tooltip
2017-11-06 23:04:49 +01:00
Philipp Hörist
970d6f8c3f New style for ChatControl
- Move ActionBar into HeaderMenu
- Make Design of ChatControl look cleaner
- Hide the Roster in Groupchats per default
- Add Button to hide/show Roster in Groupchats
- Move Groupchat topic into popover
- Display Avatars on the right side of the ChatControl and status on the
left
- Add a default Avatar for contacts that have none
2017-10-26 22:52:20 +02:00
Philipp Hörist
1c7369229e MUC: Save last message time after each message 2017-10-22 20:12:25 +02:00
Philipp Hörist
f234722456 Correctly pass authentication mechs to nbxmpp 2017-10-16 17:04:35 +02:00
Philipp Hörist
ed764789f1 Show blocked contacts as offline 2017-10-15 21:34:42 +02:00
Philipp Hörist
29cf416da4 Send Presence probe on unblock 2017-10-15 21:34:32 +02:00
Philipp Hörist
2446c7e3ed Refactor Blocking List
Fixes #8762
2017-10-15 18:03:41 +02:00
Philipp Hörist
2e9de7702f Remove discovery of generic pubsub support
We use PubSub only on our account jid, this use case is what PEP
was made for. If PEP is discovered we know that certain PubSub
features are supported, see: https://xmpp.org/extensions/xep-0163.html#defaults

The current check for <feature var='http://jabber.org/protocol/pubsub'/>
is pretty useless, as it just tells us that there is a PubSub implementation
but not much about the features. Only `publish` and `subscribe` are MUST
in XEP-0060 which is not enough for our needs.

If there is ever need to discover a generic PubSub implementation
that is not PEP we should check for all the PubSub features we need
instead of only for <feature var='http://jabber.org/protocol/pubsub'/>
2017-10-15 01:56:52 +02:00
Philipp Hörist
64d3bf63cf Discover PEP on the account jid
see: https://xmpp.org/extensions/xep-0163.html#support
2017-10-15 00:52:34 +02:00
Philipp Hörist
fcf15fcaf2 Bookmarks: Remove invalid publish option 2017-10-14 00:13:19 +02:00
Philipp Hörist
dd4a80054d Discover PublishOptions also if PubSub is not discovered
PEP supports a subset of PubSub and can also support publish options
2017-10-14 00:13:19 +02:00
Philipp Hörist
ac281533f5 Get Pubsub bookmarks also if PEP is supported 2017-10-14 00:13:19 +02:00
Philipp Hörist
e79af35e9c Refactor store_bookmarks()
- Add logging
- Move Node building code into own methods
2017-10-14 00:13:13 +02:00