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

357 Commits

Author SHA1 Message Date
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
Michael Vetter
ea35a4ceb0
Merge branch 'master' into cleanup/gchar-char 2023-05-11 08:45:46 +02:00
Steffen Jaeckel
8cd53acfd7 fix /reconnect now
This fixes #1846
Issue introduced by a0aa26b6fa

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 18:12:11 +02:00
Steffen Jaeckel
08d68d329b more auto_char
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 18:08:09 +02:00
Steffen Jaeckel
7d9c3c1b32 fix "window NULL issue" (hopefully)
There were multiple reports where after a reconnect the window of the
MUC that was last opened, was empty.

`muc_join()` creates an instance of a MUC, `presence_join_room()` works
with this instance. Therefore the instance has to exist before working on
it.

I'm not sure if this really fixes the issue, but at least it didn't
happen anymore after I applied this modification.
I can't remember how I stumbled over this, either while looking at debug
logs or while looking at Valgrind output while a reconnect happened, but
something went wrong. Then I came to the conclusion that this may fix
the issue and for now it did ... maybe it comes back, then my RCA was
wrong.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 17:51:52 +02:00
John Hernandez
7f3fca2bd0 Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended.

Reason: improve compatibility and stability. Issue #1819

Minor refactoring.
2023-05-04 16:15:09 +02:00
John Hernandez
96ddb2399e Add logging consistency
Since MUC private messages are not logged by design,
part where this logging happening is removed to add consistency.

Add explanation in comment.
2023-04-18 18:19:47 +02:00
MarcoPolo-PasTonMolo
ce688f6737 Fix empty window after reconnect
Sometimes after a reconnect the current window would get cleared. This
was a deliberate change to fix the profanity window looking all garbled
up after providing the passphrase for a gpg key using pinentry-curses.

Fixes https://github.com/profanity-im/profanity/issues/1556
2023-04-02 21:53:12 +03:00
John Hernandez
99c9f150f6 Fix PGP
Fix of PGP and potentially other encryption methods by calling correct function that would initiate them in case if someone writes.
2023-03-31 12:30:51 +02:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Michael Vetter
3bdc14dbcf Merge MAM improvements from #1724
I think this PR already solves and improves the MAM situation a lot.

What's @MarcoPolo-PasTonMolo still wanted to do in this branch is:
* MAM for mucs
* Check if url and quotes autocompletion works fine
* Check if the api still works fine
* Resolve conflicts

Conflicts are solved with this commit.

MAM for mucs can be another feature PR.

The rest we can check while being on master. And more people can help
testing.
2022-10-21 13:30:43 +02:00
Marouane L
f934c5b59f
Add vCard support
Only nicknames, photos, birthdays, addresses, telephone numbers, emails,
JIDs, titles, roles, notes, and URLs are supported

Due to the synopsis array not having enough space, `/vcard photo
open-self` and `/vcard photo save-self` are not documented properly in
the synopsis section of the `/vcard` command, but they are documented in
the arguments section

Fixed memory leak in vcard autocomplete (thanks to debXwoody)
2022-10-18 23:24:30 +01:00
MarcoPolo-PasTonMolo
a704838152 Handle late delivery 2022-08-20 22:48:02 +03:00
MarcoPolo-PasTonMolo
72f613a014 Handle MAM when chatwin gets created from incoming message 2022-07-10 12:28:14 +03:00
Michael Vetter
f30999fd51 ox: handle empty message->plain
In case we dont have plain but have body, copy this (like in
_sv_ev_incoming_pgp).
In case we have neither, return.
2022-07-04 16:40:44 +02:00
Michael Vetter
585f68f4f7 Split log.c into log.c and chatlog.c 2022-06-28 20:08:38 +02:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Stefan Ott
8044c82614 Add support for offline MUC notifications 2022-04-23 02:42:23 +02:00
Steffen Jaeckel
7f1f9787cb add profanity-specific CAfile
The profanity-internal mechanism to allow connecting to a server isn't
easily portable to cURL. Therefor introduce a profanity-specific CAfile
which is managed individually and will be configured in libcurl calls.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:01 +01:00
Steffen Jaeckel
b28ac09368 a tad more const-correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:00 +01:00
Michael Vetter
6d1c661e21 Remove banned muc member from member list
If I'm understing everything right the member should be removed here.
muc_members_update() seems to have been writen for the same purpose.

Fix https://github.com/profanity-im/profanity/issues/1594
2022-02-02 21:57:44 +01:00
Steffen Jaeckel
9cf78e59d5 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +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
Dmitry Podgorny
afdae6ac02 Reduce copy-paste in sv_ev_roster_received() 2021-07-17 18:12:42 +03:00
Dmitry Podgorny
e7b6051e57 Fix memory leak in accounts_get_login_status() 2021-07-17 18:11:32 +03:00
Thorben Günther
0fc3343d75
Restore last status string when connecting 2021-07-01 16:08:00 +02:00
Maximilian Wuttke
025c2fb1e0 Msg sending: don't write to chatwin nor to log if sending failed
Currently, only `chat_log_omemo_msg_out` can fail (i.e. return `NULL`
instead of a stanza id). In this case, the message is neither printed to
the chat window nor added to the log (since it wasn't sent).
2021-04-08 00:30:03 +02:00
Michael Vetter
057c9ad776 Add config.h in files were it was missing
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Michael Vetter
3a6bce5a09 event: make log_database_get_previous_chat safer 2021-03-25 16:47:35 +01:00
Stefan
b460d427bc OMEMO - Removed start session after roster received
Reduce the request during startup of profanity
Removed omemo_start_sessions from sv_ev_roster_received
2021-03-09 17:47:22 +01:00
Michael Vetter
8190301a67 Prevent segfault in sv_ev_incoming_message()
Regards https://github.com/profanity-im/profanity/issues/1488

Actually I would have loved to see the stanza that caused the segfault
since I'm not entirely sure whether this actually means that we do
something wrong earlier on.

Right now I don't know why the to_jid should be empty.

Let's prevent the segfault for now and see whether we get further
bugreports later.

Segfaulting issue got introduced with dd566d8d56.
2021-03-05 12:31:27 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
Michael Vetter
22b923018f Log incoming carbons if they are no MUCPM
Regards https://github.com/profanity-im/profanity/pull/1446
2020-12-09 10:49:19 +01:00
Michael Vetter
3e26364579 Fix chatlogs for outgoing carbons
Doesn't make sense to log if plain is not set in all cases.

Regards https://github.com/profanity-im/profanity/issues/1439
2020-12-08 12:26:36 +01:00
Michael Vetter
7b49fbdf45 Pass window to functions so we dont have to call twice 2020-07-09 16:11:50 +02: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
DebXWoody
2a50bb6ad7 Plain chat messages not working
Plain chat messages not working for non-carbon + no OTR support.

On master we did some clean-up. The problem is at https://github.com/profanity-im/profanity/blob/0.9.patch/src/event/server_events.c#L625 (0.9.0). The implementation looks like:

- HAVE_LIBOTR is set - _sv_ev_incoming_otr
- HAVE_LIBOTR is not set - _sv_ev_incoming_plain

I think the `_sv_ev_incoming_otr` can handle otr and plain, because I didn't find a `_sv_ev_incoming_plain` if `HAVE_LIBOTR` is set.

On master for 0.10.0 the implementation is much better:
https://github.com/profanity-im/profanity/blob/master/src/event/server_events.c#L623

But, we just call `_sv_ev_incoming_otr` independent of `HAVE_LIBOTR`.
Unfortunately, `_sv_ev_incoming_otr` is doing nothing if `HAVE_LIBOTR` is not set:
https://github.com/profanity-im/profanity/blob/master/src/event/server_events.c#L538

I did some more clean-up at sv_ev_incoming_message and changed the implementation of `_sv_ev_incoming_otr`.

```
static void
_sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
{
  // OTR or plain
        plain
}
```

The caller do not take care of `HAVE_LIBOTR`, call `_sv_ev_incoming_plain` if you are sure it's a plain message or call `_sv_ev_incoming_otr`. `_sv_ev_incoming_otr` can be used for otr / plain or for plain only.
2020-07-06 10:36:03 +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
Michael Vetter
8de6a7bfb0 And ifdefs around new OX functions
Fix for some build cases introduced in 2c94ee5a88
Fix https://github.com/profanity-im/profanity/issues/1376
2020-06-30 11:10:27 +02:00
DebXWoody
2c94ee5a88 Feature request - XEP-0373: OpenPGP for XMPP (OX)
Basic implementation of XEP-0373: OpenPGP for XMPP.
https://xmpp.org/extensions/xep-0373.html

Command /ox

Issue: #1331
2020-06-29 19:05:41 +02:00
DebXWoody
c81931c35d
Cleanup defines - client_events.c 2020-06-19 22:05:31 +02:00
DebXWoody
fa9ef70037
Clean-up task: clean up feature defines 2020-06-14 12:12:29 +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
3d7a3134af Fix offline roster contacts
Fix https://github.com/profanity-im/profanity/issues/1280
p_contact_set_presence() is triggered in
(roster_process_pending_presence) to set the presence to online
after the roster is displayed.

This happened to me _every time_ with one certain account on my server.
But not even once with other accounts on my server.

I don't understand why that is the case, but AFAIK the code should be
like it is in this PR anyways.

roster_process_pending_presence() was added there in
973a05d15a to fix
https://github.com/profanity-im/profanity/issues/1050
2020-06-02 14:24:37 +02:00
Michael Vetter
4c047b0cb5
Merge pull request #1344 from DebXWoody/bugfix/1327
Bugfix: Status with PGP shows offline in titlebar
2020-05-28 20:47:48 +02:00