about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove OMEMO session when untrusting a fingerprintPaul Fariello2019-06-072-16/+122
| | | | | | We have to store known_devices in a long term fashion otherwise we might not be able to delete session if it is remove from device list server side.
* Check for sane argument in autoconnect setMichael Vetter2019-06-051-4/+8
| | | | | Check that user doesnt do `/autoconnect set `. Which would result in: `Account '(null)' does not exist`.
* Check if valid account before setting autoconnectMichael Vetter2019-06-051-3/+7
| | | | Fixes https://github.com/profanity-im/profanity/issues/1112
* Add omemo.char theme optionMichael Vetter2019-06-051-0/+8
| | | | Thanks to @kaffekanne for noticing this!
* statusbar: check if roster existsMichael Vetter2019-06-043-2/+13
| | | | | | | | | | | | We destory the roster in ev_disconnect_cleanup(). Adding a function to test if the roster has been destroyed and testing for it in the statusbar. So now when the connection is lost 'Lost connection' is printed in all open windows. We can then reconnect with `/connect accountname`. Should fix https://github.com/profanity-im/profanity/issues/1083
* statusbar: reduce duplicate codeMichael Vetter2019-06-041-32/+9
| | | | | | | | | | status_bar_new() and status_bar_active() are almost identical. Let's use one helper function to not duplicate code. I thought about renaming both functions into one and adding another parameter but didn't come up with a good name for the function that clearly describes what it does. So staying with current names + helper functions.
* Determine chat window names beforehandMichael Vetter2019-06-041-13/+44
| | | | | | | | | Save the name for displaying the windows in the statusbar inside the tab object. So far we calculated them repeatedly and this created issues when we lost the connection. Regards https://github.com/profanity-im/profanity/issues/1083
* Merge pull request #1106 from profanity-im/saved-accountMichael Vetter2019-06-031-28/+7
|\ | | | | Don't clear saved account data in session_disconnect()
| * Don't clear saved account data in session_disconnect()Dmitry Podgorny2019-06-031-28/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If connection loss occurs, it calls session_disconnect() eventually. This function clears saved account data which is required for reconnection. Therefore, when reconnect timer expires, we get errors: 02/06/2019 04:53:42: stderr: ERR: (profanity:17115): GLib-CRITICAL **: 04:53:42.305: g_key_file_has_group: assertion 'group_name != NULL' failed 02/06/2019 04:53:43: prof: ERR: Unable to reconnect, account no longer exists: (null) To solve it, don't clear the saved data in session_disconnect(). It will be cleared properly on connection loss if reconnect timer is not configured. But won't be cleared with /disconnect command. So, after /disconnect the data will live in memory until the next /connect. Also, remove some copy-paste in connection loss path.
* | Cancel autoping timer on disconnect or connection lossDmitry Podgorny2019-06-033-8/+14
|/ | | | | | | | | If Profanity is disconnected in any way before ping response is received, the autoping timer will expire after the next connection is established. As result, user will be disconnected immediately. Cancel autoping timer in ev_disconnect_cleanup(), so it is done for all kind of disconnections.
* xmpp/connection: fix #1103Dmitry Podgorny2019-06-011-11/+28
| | | | | | | | | | | | When connection is lost, profanity tries to disconnect what leads to an infinite loop. The loop occurs, because connection_disconnet() runs xmpp_run_once() separately and waits for XMPP_CONN_DISCONNECT event. But it doesn't happen, because the connection object is disconnected. As solution, don't disconnect after XMPP_CONN_DISCONNECT is received. Also, don't free libstrophe objects while the event loops executes, because the event loop continues using objects after callbacks quit.
* Close windows on connection loss not general disc.Michael Vetter2019-05-272-1/+1
| | | | | | | | | | Call `ui_close_all_wins();` only if we disconnect on purpose not when connection is lost. Otherwise users might miss messages. This partly reverts 6ac73db876c83c7068c4795b19c09ea59eb18a40. Regards https://github.com/profanity-im/profanity/issues/1083
* Merge pull request #1092 from frnky/remove_mblenMichael Vetter2019-05-231-5/+2
|\ | | | | Don't call mblen() to not depend on locale
| * Don't call mblen() to not depend on localeFrank Zschockelt2019-05-221-5/+2
| | | | | | | | | | | | | | | | | | | | mblen will fail with return code -1 if the locale used by the unit tests isn't available on the machine. This will lead to an off by one error in some tests where the needle is at the end of the haystack. Since prof_occurrences expect null-terminated strings, the character after the needle can simply be found by incrementing the address of the found needle with strlen(needle).
* | Correctly handle malformed OMEMO messagesPaul Fariello2019-05-231-4/+8
|/ | | | Fix #1101
* Merge pull request #1098 from optmzr/fix-omemo-gen-messageMichael Vetter2019-05-221-0/+1
|\ | | | | | | | | Force UI update before generating OMEMO crypto materials The message wouldn't show up before the generation of OMEMO crypto materials started.
| * Force UI update before generating OMEMO crypto materialsWilliam Wennerström2019-05-211-0/+1
| |
* | Create seperate function for disconnect cleanupMichael Vetter2019-05-194-30/+113
|/ | | | | Duplicate code in client_events.c and server_events.c. Let's have events/common.c and a function containing that code.
* Fix ifdef guard (should have been OMEMO)Michael Vetter2019-05-061-1/+1
|
* Merge pull request #1090 from jubalh/fix/connection-loss-1089Michael Vetter2019-05-061-0/+5
|\ | | | | Reset things on connection loss
| * Reset things on connection lossMichael Vetter2019-05-061-0/+5
| | | | | | | | | | Remove the windows, clear tls certs, clean omemo. Regards https://github.com/profanity-im/profanity/issues/1089
* | Merge pull request #1084 from jubalh/occupants-charMichael Vetter2019-05-038-3/+93
|\ \ | |/ |/| Add occupants char
| * Add occupants charMichael Vetter2019-05-028-3/+93
| | | | | | | | | | | | | | `/occupants char` now sets a character that is displayed before the nick in MUCs. Similar like `/roster char` is displaying a char for the roster. Regards #690
* | Update tests with new URLMichael Vetter2019-05-031-1/+1
| | | | | | | | https://github.com/profanity-im/profanity/issues/1085
* | Update profanity URL in entity capabilities stanzaMichael Vetter2019-05-031-1/+1
| | | | | | | | Regards https://github.com/profanity-im/profanity/issues/1085
* | Update profanity URL in /tiny exampleMichael Vetter2019-05-031-1/+1
| | | | | | | | Regards https://github.com/profanity-im/profanity/issues/1085
* | Check for new profanity version using new URLMichael Vetter2019-05-032-2/+2
|/ | | | Regards https://github.com/profanity-im/profanity/issues/1085
* OMEMO: Initialize result in omemo_automatic_startMichael Vetter2019-04-291-1/+1
| | | | | | | | | This is actually not needed because result will always be set. hartmann had problems building profanity on OpenBSD and he proposed this patch. Let's use it to make the compiler happy there.
* OMEMO: Check if ID is present before using itMichael Vetter2019-04-241-1/+5
| | | | Fixes https://github.com/boothj5/profanity/issues/1079
* Fix statusbar number in themeMichael Vetter2019-04-241-1/+1
| | | | There is a typo here. So this actually never worked ;-)
* Fix formatting for privileges onMichael Vetter2019-04-241-0/+4
| | | | | `/privileges on` lists `Moderator`, `Visitor` etc. Formatting was wrong here. Printing privilige followed by nickaname in the same line.
* Occupantswin: handle newline correctlyMichael Vetter2019-04-241-6/+6
|
* Add occupants wrap to helpMichael Vetter2019-04-241-2/+4
|
* Fix occupants header char messageMichael Vetter2019-04-241-2/+2
|
* Add occupants wrap optionMichael Vetter2019-04-247-2/+33
| | | | | | | Wrapping for the occupants panel like already exists for the roster panel. See `/occupants wrap on`. Regards https://github.com/boothj5/profanity/issues/690
* Update copyright yearskaffeekanne2019-04-241-1/+1
|
* Put occupants update into own functionMichael Vetter2019-04-233-34/+21
|
* Add occupants header charMichael Vetter2019-04-238-6/+154
| | | | | | | | `/occupants header char` now sets a character that is displayed before the role (moderator, visitor..) in a room. Similar to `/roster header char` is displaying a char for the roster. Regards https://github.com/boothj5/profanity/issues/690
* Fix indentation for time configkaffeekanne2019-04-231-2/+2
|
* Adjust jid for occupants indentMichael Vetter2019-04-201-3/+11
| | | | Indent the jid one more space than nick.
* Add occupants indent autocompletionMichael Vetter2019-04-201-0/+1
|
* Allow setting occupants indent outside of MUCMichael Vetter2019-04-202-34/+31
| | | | And when not connected.
* Add /occupants indent commandMichael Vetter2019-04-187-3/+80
| | | | | | | | Roster has a `/roster contact indent` option. Now we have the same for occupants. So contacts in roster and in MUC can have configurable indentation. Regards https://github.com/boothj5/profanity/issues/690
* Fix typo in /help rosterMichael Vetter2019-04-181-1/+1
|
* Merge pull request #1063 from paulfariello/hotfix/presence-before-rosterMichael Vetter2019-04-173-0/+45
|\ | | | | Handle presence received before roster
| * Handle presence received before rosterPaul Fariello2019-04-173-0/+45
| | | | | | | | | | | | | | | | | | | | Presence of contact not found in roster are filtered out. But sometimes roster is received after a first few presences. We choose to store presences until we receive roster and then process this presences. Fixes #1050
* | Set correct year in copyright displayMichael Vetter2019-04-171-1/+1
| | | | | | | | Fixes https://github.com/boothj5/profanity/issues/1069
* | Follow OMEMO policy even when opening window on message and carbon receptionPaul Fariello2019-04-171-0/+14
|/ | | | This should close #1052
* Handle MUC anonymous state when auto starting OMEMOPaul Fariello2019-04-172-3/+15
| | | | | | | When auto joining a MUC we don't have access to required information so we just don't start OMEMO at this time. Once we receive disco info we then try to start OMEMO.
* Handle missing real jid in OMEMO encrypted MUCPaul Fariello2019-04-171-3/+7
| | | | | | | This should never happens since we should ensure MUC is Non-Anonymous before enabling OMEMO. But we should neither segfault if this happens.