Commit Graph

819 Commits

Author SHA1 Message Date
lovetox 2d6e7d2eee Get rid of python-avahi 2018-05-23 11:47:13 +02:00
Philipp Hörist bc24ab470d Fix translation in flatpak build
Fixes #9138
2018-05-23 08:38:09 +02:00
Philipp Hörist d0ec9812a6 Fix Zeroconf
- Port pybonjour code from gajim_0.16 branch
- Fix some other small things that broke zeroconf
2018-05-22 23:38:04 +02:00
Philipp Hörist 7b0cbb7763 Fix detecting language 2018-05-21 21:49:19 +02:00
Philipp Hörist 2410121ddb Add dedicated zeroconf menu 2018-05-21 21:18:38 +02:00
Philipp Hörist b3162f400c Detect if we run as flatpak
Fixes #9110
2018-05-21 19:17:47 +02:00
Philipp Hörist 59cfddc3ca Fix first start with no accounts 2018-05-21 18:57:18 +02:00
Philipp Hörist 714d70cb23 Dont get current version from config 2018-05-21 18:49:06 +02:00
Philipp Hörist 0ea721fbf1 Fix log message
Presence without vcard hash is not invalid
2018-05-21 18:38:47 +02:00
Philipp Hörist 764b275394 Dont show encryption methods if not supported 2018-05-21 18:09:44 +02:00
Philipp Hörist 7040ea6b2e Move module calls into init
On Linux ctypes has not attr windll, move it into the __init__()
so it does not get evaluatet on module import
2018-05-21 02:39:29 +02:00
Philipp Hörist c5df74c509 Refactor idle module
- Get rid of sleepy.py, handle everything in idle.py
- Introduce one Monitor class that handles everything
2018-05-21 02:32:33 +02:00
Sophie Herold 2e5d966f1d Support for idle time under GNOME without X11
* Removes use of most global variables
* Adds some some logging
* Removes unused close() method for Xss
2018-05-20 20:45:46 +02:00
Philipp Hörist 3e0557dae6 Dont build menu for Local account 2018-05-20 20:15:08 +02:00
Philipp Hörist 848cdc4a88 ProfileWindow: Remove redundant menu entry 2018-05-20 01:28:12 +02:00
Philipp Hörist 2819232808 Fix AvatarChooserDialog not beeing native
Setting mimetypes forces non-native dialogs
2018-05-20 01:28:12 +02:00
Philipp Hörist 2636e3449f Refactor avatar publishing
- Publish avatars with a size of 200x200
- Add AvatarSize.PUBLISH so we can easily change it in the future
- Dont upscale small avatars on publish
- Use surfaces for displaying the avatar in ProfileWindow and VcardWindow
because this scales correctly on HiDPI screens
2018-05-20 01:28:12 +02:00
Philipp Hörist 381c7f2ee7 Update Gajim version to 1.0.3 2018-05-19 10:57:49 +02:00
Philipp Hörist bc22bbad5d Raise required nbxmpp version 2018-05-19 10:50:43 +02:00
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 3b130db60c Simplify set_i18n_env()
We already determine LANG in initialize_lang()

getdefaultlocale() takes env var LANG into consideration
2018-05-17 20:07:30 +02:00
Philipp Hörist 03aa1db306 Handle LC_ALL=C correctly
We default to 'en' for LANG if LC_ALL=C is set
2018-05-17 20:01:59 +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
BBreeziN f13ff8ac68 Fix call to config.get_per() in method that gets account name from jid 2018-05-15 23:39:44 -04:00
Philipp Hörist 3c22ab752a Bring control to front when notification is clicked
if autopopup_chat_opened is activated no control is found because
the event that triggered the notification is already deleted when
the notification is clicked by the user. So instead of searching
for the event, search for the control with jid/account.

Fixes #9124
2018-05-12 23:36:52 +02:00
Philipp Hörist 04b86a7bd0 Dont show OOB uri if message body is the same
if oob uri == body there is no need to show the uri
below the message
2018-05-10 16:16:38 +02:00
Philipp Hörist ffe8ee8068 Return account instead of jid 2018-05-10 13:28:26 +02:00
Philipp Hörist 093ba8dd97 Provide method to get the account name from a jid 2018-05-10 10:53:56 +02:00
Philipp Hörist 2bb5d55c03 Add conversion from account_id to account jid
To use this alias `account_id` with `account`

Example: SELECT account_id as account FROM logs
2018-05-08 19:20:11 +02:00
Philipp Hörist 8b9eb59ee4 Set no-store hint on groupchat chatstates 2018-05-07 18:04:24 +02:00
Philipp Hörist 1ecf0ec008 Use NativeFileChoosers on Windows and MacOS
These platforms integrate a file preview in their native filechoosers
2018-05-06 09:17:58 +02:00
Philipp Hörist 913634c4c6 Add menu for uploading room avatars 2018-05-06 09:11:32 +02:00
Markus Wintermann e9a4b372e2 Select account in account list if edited
Before: After a rightclick -> "Modify Account" on an account in the
roster the preferences of the account are shown but the account is not
selected in the account list.
After: account will be selected in the account list too
2018-05-05 14:19:17 +02:00
Philipp Hörist c38db84e04 Refactor FileChooserDialogs
Use GtkFileChooserDialog only when we need previews, default to
NativeFileChooser otherwise.

GtkFileChooserDialogs have a long list of issues, so lets only use it
if we gain something from it.

Flatpak should only run NativeFileChoosers because its sandboxed and
this is needed for security purposes. As a result of that, Flatpak Users
dont have image previews in the FileOpenDialogs

Refactor all FileChoosers for a more simple approach when we use them

Add a new SendFileDialog, so we dont have to put widgets into the FileChooser
which forces non-native Dialogs.
2018-05-05 09:22:08 +02:00
Philipp Hörist bb33e055a5 Fix regression from refactoring
regression was introduced in e2383fd7a4
2018-05-02 22:38:07 +02:00
Philipp Hörist 497c710dd8 Remove unused Dialog
Using a FileChooserDialog for this is overkill, use FileChooserButton
in the future
2018-05-02 22:38:07 +02:00
Philipp Hörist 0f7097b7e0 Remove unused Dialog
This was nonfunctional for a long time and nobody complained
2018-05-02 22:38:07 +02:00
Philipp Hörist fc9d242f65 Refactor ManageSoundsWindow
- Move code into ui file
- Use FileChooserButton instead of FileChooserDialog
- Make methods private
- Simplify code
2018-05-02 22:38:07 +02:00
Marcin Mielniczuk ad4c1347ff Be more descriptive about the ascii_emoticons configuration option 2018-05-02 20:19:24 +02:00
Philipp Hörist ba08ddfef0 Remove not used Dialog
We use now a Gtk.FileChooserButton for client certs
2018-05-02 19:48:44 +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 779a4d4ce3 Get version from package instead of config 2018-05-01 00:37:13 +02:00
Marco Cirillo a937b0a5e2 servers.xml: re-add lightwitch.org as IBR was re-enabled. 2018-04-30 20:35:28 +02:00
Philipp Hörist 81952f6a7c Convert font weight from pango to css values
Fixes #9106
2018-04-30 17:43:32 +02:00
Yann Leboulanger b5c51932f4 update version to 1.0.2 2018-04-30 17:04:58 +02:00
Philipp Hörist 9aea8eea38 Depend on nbxmpp 0.6.5 2018-04-30 16:57:19 +02:00
Philipp Hörist 3b73b6f5bb Windows: Always hide roster window on X
As all Windows versions have a status icon and most Windows users expect this

Fixes #9031
2018-04-30 00:35:48 +02:00
Philipp Hörist 06c4ce60b9 Show correct account lable in tooltip
Fixes #9065
2018-04-29 23:47:30 +02:00
Philipp Hörist e0e3b9609a Dont set urgency when we already set priority
set_urgent is deprecated in favor of set_priority

Fixes #9101
2018-04-29 23:38:16 +02:00
Philipp Hörist 56a5d01609 Dont allow plain BOSH by default 2018-04-29 23:34:46 +02:00
Philipp Hörist b8554e3e22 Jingle: Check first if we have a content
Fixes #9094
2018-04-29 23:30:08 +02:00
Markus Wintermann 49bfc1f226 Add support for dynamic reloading of plugins
‎* rename the remove_plugin function to uninstall_plugin because it
deletes files on the disc and uninstall is the label of the button which
triggers this function
* added a new remove_plugin function, which deactivates the plugin (if
needed), removes it from the list of managed plugins and deletes the
contents of sys.modules
2018-04-28 13:31:19 +02:00
Philipp Hörist 707599dd86 Dont determine paths at module import time 2018-04-25 21:26:02 +02:00
Philipp Hörist 8c23d5a4b5 Move some imports 2018-04-25 21:24:05 +02:00
Philipp Hörist b4f6116e3b Import app only once 2018-04-25 20:59:23 +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 52cbae69ee Refactor Gajim startup
Remove as much as possible startup code from GtkApplication to stay
more true to our goal to separate GUI from the rest of Gajim
2018-04-25 19:16:38 +02:00
Philipp Hörist e2383fd7a4 Refactor i18n module
- Move everything translation related from gajim.py to i18n.py
2018-04-24 23:03:19 +02:00
Philipp Hörist 21d4d0cb1e Remove unused import / codestyle
Pass args to logging method instead of string formatting
2018-04-24 21:34:53 +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
Philipp Hörist 5ee45b86e9 Refactor database migration
- Move database migration to the logger module
- Dont depend on Gajim version for migration use PRAGMA user_version
- Refactoring of some methods in the logger module
- Dont use cursor object, if there is no reason
- Make some attributes and methods private
2018-04-23 21:27:01 +02:00
Philipp Hörist 4c1bfda48d Fix const imports 2018-04-23 18:32:01 +02:00
Philipp Hörist 4f2033faff Move constants into const module 2018-04-23 18:23:57 +02:00
Philipp Hörist 86bfc81ad3 Remove old unused migration method 2018-04-23 17:34:14 +02:00
Philipp Hörist 3efa731fbf Add stanza_id index also when we create the DB 2018-04-23 00:10:35 +02:00
Philipp Hörist 8306f076b3 Move path creation into configpaths module 2018-04-22 23:12:34 +02:00
Philipp Hörist 124e501f26 Make ExceptionDialog easier to test 2018-04-22 22:34:27 +02:00
Philipp Hörist 188fb85bd0 Move DB creating into logger module 2018-04-22 22:16:17 +02:00
Philipp Hörist efd2ca50c6 Remove unused old migration method 2018-04-22 02:30:34 +02:00
Philipp Hörist 3ad539cbf2 Make sure all config dirs get created
LOG_DB_FOLDER and CACHE_DB_FOLDER are equal to MY_DATA and MY_CACHE
2018-04-22 02:30:08 +02:00
Philipp Hörist 220bf35827 Create some folders only on demand 2018-04-22 00:55:48 +02:00
Philipp Hörist c0c16dbf94 Dont change path names because plugins use them 2018-04-21 21:28:19 +02:00
Philipp Hörist 848c5cbdd0 More refactoring around paths
- Remove old config dir migration
- Remove some unused config paths
- Rewrite configpaths.init()
- Simplify creating paths in check_paths
2018-04-21 21:19:32 +02:00
Philipp Hörist 72e69a59af Fix setting custom config root 2018-04-21 14:47:47 +02:00
Philipp Hörist b0fce17cf2 HistoryManager: Open window centered 2018-04-21 13:59:30 +02:00
Philipp Hörist 0739eb9dec HistoryManager: Init configpaths only in standalone mode 2018-04-21 13:59:20 +02:00
Philipp Hörist 4a26ecb12c Refactor configpaths
- init configpaths earlier so logging can access it to store debug logs
- First step for more consistency across Gajim when looking up paths

  Recommended usage for the future:
  app.configpaths.get()
  configpaths.get()
2018-04-21 12:48:57 +02:00
philipp 8e9c040acf Support http:upload:0 2018-04-20 08:35:40 -04:00
Philipp Hörist dadc85bb52 Fix tests 2018-04-19 22:22:04 +02:00
Philipp Hörist 290e761f88 Add support for Room Avatars
- Groupchats promote a vcard hash with presence

Refactoring:

- Dont delete groupchat contacts if they are maximized from the roster
- Roster and GroupchatControl use the same contact object
2018-04-19 22:11:41 +02:00
Philipp Hörist 70a7000d44 Dont be lenient with namespace 2018-04-19 17:59:17 +02:00
Philipp Hörist a45554a10b Save history export with utf8 encoding 2018-04-17 22:00:15 +02:00
Philipp Hörist 53b38bd5d5 Use JID as default account name
Fixes #8939
2018-04-15 23:36:34 +02:00
Philipp Hörist e3066fb5ca Improve AccountsWindow design
Fixes #8940
2018-04-15 23:36:34 +02:00
Daniel e93ab408ec Fix History Manager search 2018-04-15 22:45:04 +02:00
Markus Wintermann a86abf2cf9 Update proxy comobobox in accounts/connections
After a new proxy was added/removed by ManageProxies the combobox in
accounts/connections gets updated
2018-04-14 22:01:58 +02:00
Philipp Hörist 93af68f81c Dont show error when receiving invalid avatars
Fixes #9022
2018-04-14 10:34:58 +02:00
Daniel 9f0eaf9df7 Fix placeholder not being removed when inserting nick in MUC via context menu 2018-04-13 22:36:57 +02:00
Philipp Hörist 363fdf7d9a Dont use str as a var name 2018-04-09 21:39:57 +02:00
Philipp Hörist cf8f0c2e83 Delete account from config if registration fails 2018-04-09 19:14:42 +02:00
Philipp Hörist 6baed38d4c Make code better understandable 2018-04-09 00:35:27 +02:00
Bronko fcad0f088a save hash and mime_type of avatar when receiving vCard from server
in case the avatar is not changed by the user we must resend the still valid hash.
if we do not save the hash here, gajim advertises an empty photo element after publishing the vCard,
which removes the avatar for all receiving clients of the photo element update
2018-04-08 23:45:32 +02:00
Bronko 36b31259e7 save encoded avatar when receiving vCard from server 2018-04-08 20:58:24 +02:00
Yann Leboulanger 879e03449c fix some py2->py3 missing things. Fixes #9019 2018-04-07 23:06:48 +02:00
Yann Leboulanger 6d868546fa update action when creating groupchat window. Fixes #9042 2018-04-07 22:48:38 +02:00
Yann Leboulanger 27e45856b0 prevent traceback. Fixes #9054 2018-04-07 22:04:32 +02:00
Yann Leboulanger 93b50bf1f6 prevent a traceback with wrong bookmarks. Fixes #9055 2018-04-07 22:01:39 +02:00
Philipp Hörist cf911b3984 Fix regression from 4caa4971 2018-04-05 22:14:57 +02:00
Philipp Hörist 711f3cbbb0 Encode filenames before sending
Fixes #9039
2018-04-05 19:38:17 +02:00
Philipp Hörist 898ac96647 Some status codes should only be in our presence
Some Servers broadcast these status codes in every presence which
is wrong accoring to the XEP
2018-04-04 22:16:46 +02:00
Philipp Hörist 1b8d76bf9e Add missing return statement 2018-04-04 22:10:34 +02:00
Yann Leboulanger 2ea9fc6932 when adding bookmark, check server validity on focus out only. Fixes #7879 2018-04-04 15:16:41 +02:00
Yann Leboulanger 17ae4e4ccc Hide protocol combobox when adding contacts if only XMPP is available 2018-04-04 14:46:46 +02:00
Yann Leboulanger 8e144e46f8 Use XMPP logo in add contact dialog for XMPP protocol. Fixes #9049 2018-04-04 14:42:10 +02:00
Yann Leboulanger dc58586a7a mark string as translatable. Fixes #9050 2018-04-04 14:23:12 +02:00
Philipp Hörist 4caa4971b2 Catch decrypted-message-received event in ChatControl
It makes more sense to catch the event with ChatControl than with the
RosterWindow. RosterWindow is only used now if no ChatControl is open.
2018-04-04 01:13:02 +02:00
Philipp Hörist 8a4264c94e Remove event handler on ChatControl Shutdown 2018-04-04 00:00:08 +02:00
Philipp Hörist f29d57e50b Catch invalid IQ stanzas and log them
Fixes #9044
2018-04-03 19:54:09 +02:00
Philipp Hörist 199f1c74ff Dont call show_all() on AboutDialog
Fixes #9038
2018-04-02 21:37:08 +02:00
André Apitzsch 672aae9c12 Fix password storage in plain text issue 2018-04-02 15:50:23 +02:00
Yann Leboulanger dc3565ee32 prepare 1.0.1 release 2018-04-01 22:48:42 +02:00
Yann Leboulanger 0f13b23a7d correctly set process name. Fixes #9034 2018-04-01 15:05:06 +02:00
Philipp Hörist e326aabf5f Decode PGP decrypted messages 2018-03-31 01:18:28 +02:00
Philipp Hörist 634cbd93a8 Remove not supported methods
Methods have been remove in from IPython since 2016
b7d03ed6b1 (diff-3ffc5a89fb88284fe9b5787b8859140b)

Fixes #9023
2018-03-30 15:05:25 +02:00
Yann Leboulanger ec78ce22e6 don't allow to open several filter dialogs. Fixes #8848 2018-03-29 12:26:37 +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 a884ba6762 prevent traceback. Fixes #8936 2018-03-29 09:41:40 +02:00
André Apitzsch 612b7b4302 Show help lines only once
fixes #9018
2018-03-28 20:13:05 +02:00
Yann Leboulanger a9a6b048fb set a transient_for for join groupchat dialog when needed. Fixes #8994 2018-03-28 16:14:54 +02:00
Yann Leboulanger 16b8eb1fd0 ability to fix room name when browsing muc service. See #8994 2018-03-28 15:22:28 +02:00
Yann Leboulanger f52e8d889c don't traceback on account deletion. Fixes #8960 2018-03-28 11:36:14 +02:00
Philipp Hörist 241deac31c ChatControl: Display status message nicer 2018-03-27 23:43:24 +02:00
Yann Leboulanger a3853f6958 fix string 2018-03-27 15:02:11 +02:00
Yann Leboulanger 7562acbe5b correctly generate css for font that have a space. Fixes #9012 2018-03-27 12:25:20 +02:00
Philipp Hörist 5794d54d1c Dont print status if it has not changed
Only print the status, if status has changed or the status message

Clients announce there idle-time with presences but adding a idle-time
does not necessarily mean they went from available -> away

Fixes #9001
2018-03-26 23:47:43 +02:00
Philipp Hörist 4f1ba653e1 Raise min GTK version to 3.22 2018-03-26 19:41:41 +02:00
Yann Leboulanger 5353f770a1 Fix button text. Fixes #9005 2018-03-26 17:45:32 +02:00
Philipp Hörist 99b3aebc99 Remove unused imports 2018-03-26 01:06:56 +02:00
Philipp Hörist 6f55cf3dd4 Fix some problematic imports 2018-03-26 00:19:59 +02:00
Philipp Hörist b54f27599c Set min-width for notebooks tabs
Fixes #8973
2018-03-25 23:28:17 +02:00
Roland Pallai 23add367be Fix regression in a4291a27 2018-03-25 22:46:51 +02:00
Roland Pallai a4291a27f1 Fix sound playback for received group chat messages
Testing for historical messages was broken because `msg_obj.timestamp`
second resolution assumed but this is false and this led to broken
sound playback for received group chat messages.
2018-03-25 22:26:59 +02:00
Philipp Hörist 69fd7dc737 Groupchat: Set minimize on auto join default True 2018-03-25 21:34:42 +02:00
Yann Leboulanger 5874f5c388 ability to run history manager even when -s option is used to run Gajim 2018-03-25 20:52:36 +02:00
Yann Leboulanger e44d5e9778 typo 2018-03-25 18:29:17 +02:00
Yann Leboulanger a336f48b67 more string improvements 2018-03-25 18:20:37 +02:00
Yann Leboulanger faa88819a1 improve some strings 2018-03-25 16:26:29 +02:00
Philipp Hörist f7d9c16735 MessageTextView: Remove placeholder on paste
Fixes #8975
2018-03-25 01:39:16 +01:00
Philipp Hörist 6bd6294ab2 Disable autoscroll when moving the slider 2018-03-25 01:16:20 +01:00
Philipp Hörist 040521397e Dont use invalid sound devices
PulseAudio has devices that are None

Fixes #8797
2018-03-25 00:48:29 +01:00
Philipp Hörist af9552d704 Fix Autoscroll (for real this time)
Fixes #8992
2018-03-25 00:36:48 +01:00
Philipp Hörist 6207e607a8 Fix NoneType Error
element can be None if there was a error while calling Gst.ElementFactory.make()
2018-03-24 21:57:40 +01: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