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

72 Commits

Author SHA1 Message Date
Steffen Jaeckel
848acdd1fa Improve const correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2024-06-19 16:01:46 +02:00
Steffen Jaeckel
b4c088232e Improve const correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:27:09 +01:00
Steffen Jaeckel
835ea397ac Tidy up some code
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:26:21 +01:00
John Hernandez
029f1caa52 Cleanup jid_destroy to auto_jid
Remove unused variables
Apply minor cleanups
2023-07-13 17:05:07 +02:00
John Hernandez
8304ac86ff g_free() to auto_gfree, introduce auto_guchar
Fix 11 potential mem leaks in theme.c
2023-07-13 17:04:59 +02:00
John Hernandez
e1d137f4e6 Change char->free to auto_char char for autocleanup
Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
John Hernandez
4a70f5f513 Cleanup char* to auto_gchar gchar* for prefs_get_string
Necessity explained in #1819
2023-07-03 16:06:27 +02:00
Steffen Jaeckel
e886ba0c6f fix more memory leaks
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:11:13 +01:00
Steffen Jaeckel
a0aa26b6fa add now option to /reconnect command
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Michael Vetter
9f13b9e939 Make mood display optional 2022-06-22 11:32:27 +02:00
Steffen Jaeckel
7a2af5e3ad fix handling of connection errors
When a `see-other-host` stream-error is received we try to re-connect to
the other host. Erroneously this also started the `reconnect_timer`.
This lead to the behavior that in cases where e.g. the login failed
we try to reconnect instead of bailing out with an error.

This commit fixes the wrong behavior by not starting the `reconnect_timer`.

Fix 0e58509c16

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-08 19:52:13 +01:00
Steffen Jaeckel
0e58509c16 handle see-other-host XMPP stream error
Fixes #1628

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:52:08 +01:00
Steffen Jaeckel
20a8ef7a3e session: combine internal free-functions
`_session_free_saved_details()` remains as it's still required alone

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +01:00
DebXWoody
2f3de0eb0d xep-0107: code review
* Remarks in the Merge Request (ac_reset, help)
* Defines in iq.c
* Mood help and null check
* Added additional information about tab key in CMD_DESC.
* Added additional null check
2021-12-06 13:33:21 +01:00
DebXWoody
23e886ed5e Add xep-0107: User Mood support
Implementation of XEP 0107 - User Mood
2021-12-06 13:32:54 +01:00
Michael Vetter
46c8245af9 Format new register code correctly 2021-10-13 21:32:44 +02:00
swirl
87d2c95c87 registration: remove auth param and excess functions 2021-08-17 14:09:48 -04:00
swirl
2cc354b6ae fixed some bugs, added some more
- Added JABBER_RAW_CONNECT[ING/ED] connection states
- Added cl_ev_connect_raw and session_connect_raw to conform to normal
connection functions
- Fixed SIGABRT during registration
- Added a check in cmd_register to ensure it's actually connected before
registering--but this will always fail atm
2021-08-17 14:09:48 -04:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +02:00
Dmitry Podgorny
ac410445af Add option for legacy authentication
New options:
  /connect <account> [auth default|legacy]
  /account <account> set auth default|legacy

Fixes #1236.
2020-06-05 11:37:51 +03:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
b8c8059402 Call message_handlers_clear() upon disconnect
Free pubsub_event_handlers. Fix memory leaks.
2019-06-20 12:37:32 +02:00
Michael Vetter
11b8204d14 Call iq_handlers_clear() upon disconnect
Free id_handlers. Fix memory leaks.
2019-06-20 12:37:32 +02: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
Paul Fariello
9714d1d867 Add random string at the end of the default resource
When connecting for the first time or when creating a new account don't
use only 'profanity' as default resource.

Some server don't support having 2 connection with same resource. Using
profanity as default lead to deconnections.
2019-04-12 15:49:54 +02:00
Paul Fariello
4ad6904216 Wait for discovery end to publish omemo devicelist and bundle
Add sv_ev_connection_features_received for that purpose
2019-04-10 17:23:46 +02:00
Paul Fariello
f7ce1607f9 Ensure saved_account is set before calling sv_ev_login_account_success 2019-04-10 17:12:31 +02:00
Paul Fariello
0dd5441f92 device_list iq should be from barejid or none
Ensure we request device_list and remove non conforming handling of
responses.

Move initialisation of iq_handlers before call to sv_ev_login_account_success
2019-04-10 17:12:31 +02:00
Paul Fariello
756fefb09a Fix devicelist subscription and handle pubsub event
Devicelist subscription can be done directly with caps_add feature.
2019-04-10 16:03:50 +02:00
Paul Fariello
fdc5f25f2d Add devicelist and bundle publication 2019-04-10 16:03:50 +02:00
Paul Fariello
bce1981128 Add devicelist subscription 2019-04-10 15:37:22 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
James Booth
e6d9a243cd Clear rooms cache on disconnect 2018-02-05 20:30:20 +00:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
James Booth
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
2b7894ccff Remove status from cl_ev_presence_send
fixes #888
2017-01-15 23:59:31 +00:00
James Booth
e043029a50 Allow clearing account resource
issue #880
2016-11-22 00:39:52 +00:00
James Booth
3396e75d23 Handle NULL saved_status 2016-07-27 23:35:49 +01:00
James Booth
a1f48f8457 Copy curr_status and free original in session.c 2016-07-27 22:07:11 +01:00
James Booth
8633cd6e29 Free ProfAccount 2016-07-25 22:38:23 +01:00
James Booth
e7bfaa643f Move autoaway check 2016-07-24 16:06:24 +01:00
James Booth
0a57c4de78 Tidy headers 2016-07-24 15:43:51 +01:00
James Booth
0649aad80d Move event timeout to connection module 2016-07-24 14:08:30 +01:00
James Booth
e8fc80f5c1 Update GPL link in headers 2016-07-24 01:14:49 +01:00
James Booth
b935b4621c Add connection_set_disconnected() 2016-05-11 00:02:39 +01:00
James Booth
7e079f3684 Add connection_clear_data() 2016-05-10 23:53:44 +01:00
James Booth
a7fa27df01 Remove connection_free_conn(), connection_free_ctx() 2016-05-10 23:34:25 +01:00