1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00
Commit Graph

5205 Commits

Author SHA1 Message Date
Michael Vetter
c03f936390
Merge pull request #1111 from profanity-im/feature/theme-omemo-char
Add omemo.char to themes
2019-06-05 12:34:48 +02:00
Michael Vetter
84ccee2093 Add omemo.char to themes 2019-06-05 11:01:58 +02:00
Michael Vetter
c57d0b8c8e Add omemo.char theme option
Thanks to @kaffekanne for noticing this!
2019-06-05 11:01:08 +02:00
Michael Vetter
fcf4d14374 Document statusbar.time theme feature
Users where under the impression that you can't colour the time displayed
in the statusbar.
Let's add it to the template, and also change all themes to use the same
colour for the time as for the statusbar text.
2019-06-05 10:40:03 +02:00
Michael Vetter
06f5e94dd7
Merge pull request #1109 from profanity-im/fix/1083
Fix SIGABRT on lost connection
2019-06-05 09:40:24 +02:00
Michael Vetter
7b434954b2 Add release dates to changelog 2019-06-05 09:10:59 +02:00
Michael Vetter
b210fb3603 statusbar: check if roster exists
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
2019-06-04 16:19:04 +02:00
Michael Vetter
2d00444702 statusbar: reduce duplicate code
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.
2019-06-04 14:50:25 +02:00
Michael Vetter
ea62c3f293 Determine chat window names beforehand
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
2019-06-04 12:33:57 +02:00
Michael Vetter
48013f8d43
Merge pull request #1106 from profanity-im/saved-account
Don't clear saved account data in session_disconnect()
2019-06-03 14:11:00 +02:00
Michael Vetter
2052a511c3
Merge pull request #1105 from profanity-im/autoping-timer-cancel
Cancel autoping timer on disconnect or connection loss
2019-06-03 13:53:15 +02:00
Dmitry Podgorny
6138a5f79b Cancel autoping timer on disconnect or connection loss
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.
2019-06-03 13:28:00 +03:00
Dmitry Podgorny
4344ee2a5a Don't clear saved account data in session_disconnect()
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.
2019-06-03 13:21:52 +03:00
Michael Vetter
5b4277840a
Merge pull request #1104 from profanity-im/fix-1103
xmpp/connection: fix #1103
2019-06-03 11:00:08 +02:00
Dmitry Podgorny
c2d3c3e416 xmpp/connection: fix #1103
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.
2019-06-01 20:21:46 +03:00
Michael Vetter
bfa4a2ef1f Close windows on connection loss not general disc.
Call `ui_close_all_wins();` only if we disconnect on purpose not when
connection is lost.

Otherwise users might miss messages.

This partly reverts 6ac73db876.
Regards https://github.com/profanity-im/profanity/issues/1083
2019-05-27 12:52:04 +02:00
Michael Vetter
eb16c674ae
Merge pull request #1092 from frnky/remove_mblen
Don't call mblen() to not depend on locale
2019-05-23 21:18:46 +02:00
Michael Vetter
6c8acb1a95
Merge pull request #1102 from paulfariello/fix/malformed-omemo-message
Correctly handle malformed OMEMO messages
2019-05-23 13:54:52 +02:00
Paul Fariello
04cd1b4409 Correctly handle malformed OMEMO messages
Fix #1101
2019-05-23 13:12:02 +02:00
Frank Zschockelt
56e925ed03 Don't call mblen() to not depend on locale
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).
2019-05-22 19:57:52 +02:00
Michael Vetter
91d17edcb4
Merge pull request #1098 from optmzr/fix-omemo-gen-message
Force UI update before generating OMEMO crypto materials

The message wouldn't show up before the generation of OMEMO crypto materials started.
2019-05-22 09:52:29 +02:00
William Wennerström
e07a06d1a2
Force UI update before generating OMEMO crypto materials 2019-05-21 22:32:06 +02:00
Michael Vetter
883dbe1911 Create seperate function for disconnect cleanup
Duplicate code in client_events.c and server_events.c. Let's have
events/common.c and a function containing that code.
2019-05-19 22:57:51 +02:00
Michael Vetter
813949667c
Merge pull request #1091 from frnky/fix_tests_on_32bit
Fix unit tests on 32-bit architectures
2019-05-17 21:51:44 +02:00
Frank Zschockelt
4683395aca Use mock_type() for casting mock() 2019-05-08 21:52:16 +02:00
Frank Zschockelt
a5db791dc4 Use mock_ptr_type() to silence compiler warnings
Unit tests on 32-bit architectures were failing due to
"cast to pointer from integer of different size" warnings.
mock_ptr_type silences those by first casting to uintptr_t.
2019-05-08 21:51:29 +02:00
Michael Vetter
c94f3d0b4a Fix ifdef guard (should have been OMEMO) 2019-05-06 16:11:22 +02:00
Michael Vetter
9ecc14c95d
Merge pull request #1090 from jubalh/fix/connection-loss-1089
Reset things on connection loss
2019-05-06 16:06:41 +02:00
Michael Vetter
6ac73db876 Reset things on connection loss
Remove the windows, clear tls certs, clean omemo.
Regards https://github.com/profanity-im/profanity/issues/1089
2019-05-06 12:30:33 +02:00
Michael Vetter
4a165b81e6
Merge pull request #1084 from jubalh/occupants-char
Add occupants char
2019-05-03 11:11:40 +02:00
Michael Vetter
45ea73125f Update travis URL 2019-05-03 10:59:39 +02:00
Michael Vetter
d4892b29c4 Update profanity repo URL
Move from github.com/boothj5/* to github.com/profanity-im/*
2019-05-03 10:51:28 +02:00
Michael Vetter
a28f0d9e74 Update tests with new URL
https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:46:41 +02:00
Michael Vetter
ebbacec667 Update profanity URL in entity capabilities stanza
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:36:26 +02:00
Michael Vetter
9288621320 Update profanity URL in /tiny example
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:33:52 +02:00
Michael Vetter
1446ac15cb Check for new profanity version using new URL
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:33:46 +02:00
Michael Vetter
83433ee8e0 Update profanity URL in spec file
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:28:04 +02:00
Michael Vetter
6f59a57b68 Update profanity URL in manpage
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:27:13 +02:00
Michael Vetter
187a2a07cd Replace profanity URL in README
Regards https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:26:48 +02:00
Michael Vetter
f082563bf2 Add occupants char
`/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
2019-05-02 17:01:55 +02:00
Michael Vetter
722cb5fdc3 OMEMO: Initialize result in omemo_automatic_start
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.
2019-04-29 11:32:22 +02:00
Michael Vetter
9dd441aa39
Merge pull request #1080 from jubalh/omemo-no-device-id
OMEMO: Check if ID is present before using it
2019-04-24 15:51:08 +02:00
Michael Vetter
a794dadfa9 OMEMO: Check if ID is present before using it
Fixes https://github.com/boothj5/profanity/issues/1079
2019-04-24 15:20:54 +02:00
Michael Vetter
32a25179f3
Merge pull request #1078 from jubalh/statusbarnu
Fix statusbar number in theme
2019-04-24 14:50:16 +02:00
Michael Vetter
1d2c0ddc69 Fix statusbar number in theme
There is a typo here. So this actually never worked ;-)
2019-04-24 14:48:24 +02:00
Michael Vetter
01e13f98fd Add occupants.wrap to theme template 2019-04-24 10:50:01 +02:00
Michael Vetter
a666f0deae Fix formatting for privileges on
`/privileges on` lists `Moderator`, `Visitor` etc. Formatting was wrong
here. Printing privilige followed by nickaname in the same line.
2019-04-24 10:28:27 +02:00
Michael Vetter
30f9de61d0 Occupantswin: handle newline correctly 2019-04-24 09:49:14 +02:00
Michael Vetter
98f768bdc2 Add occupants wrap to help 2019-04-24 09:49:14 +02:00
Michael Vetter
259c5801cf Fix occupants header char message 2019-04-24 09:49:14 +02:00