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

264 Commits

Author SHA1 Message Date
Michael Vetter
f81ed759f5 stanza: guard mallocs
If this happens we have more serious problems :-)
But anyways..
2021-03-25 16:14:40 +01:00
Michael Vetter
fde0a0d1c6 Add support to register with a room
`/affiliation register` can now be used to register a nickname with a
MUC.

Tested with a server without forms. Couldn't find a server which
supports forms yet.

Implements https://github.com/profanity-im/profanity/issues/1210
2021-03-25 11:05:58 +01:00
Michael Vetter
a7ecda7773
Merge pull request #1501 from xenrox/change-password
Add command to change password of logged in user
2021-03-11 18:18:03 +01:00
Thorben Günther
b0aea2bcff
Add command to change password of logged in user 2021-03-11 17:42:53 +01:00
Maximilian Wuttke
e217ed0b79 Update to the newest version of XEP 0363 (HTTP Upload)
Main changes:

1. Attributes instead of tags
2. Read the optional <header> tags and send them in the HTTP PUT header:

   * Authorization
   * Cookie
   * Expires

Co-authored-by: Martin Dosch <martin@mdosch.de>
2021-03-11 17:11:22 +01:00
Michael Vetter
c2ec3e7033 Enable error logging on MAM RSM 2021-01-28 14:44:53 +01:00
Michael Vetter
840238b126 Get MAM from last 7 days
Probably should make this configurable later.
2021-01-28 14:44:53 +01:00
Michael Vetter
d3303517f7 MAM: Request more pages via RSM
Send another request with same jid and last id we got.
2021-01-28 14:44:53 +01:00
Michael Vetter
6e1e01dbb8 Adapt MAM RSM code to latest functions
Some functions changed in the meantime.
stanza_get_child_by_name_and_ns() got dropped and
xmpp_stanza_get_child_by_name_and_ns() from newer libstrophe is used.
2021-01-28 14:44:53 +01:00
Michael Vetter
db65255a5a wip: add rsm after we get the first couple of mam messages 2021-01-28 14:44:53 +01:00
Michael Vetter
69e35e86b2 mam: Use correct ID in rsm handler
Thanks to DebXWoody for the help.
2021-01-28 14:44:53 +01:00
Michael Vetter
d06ca64098 mam: fix logging message 2021-01-28 14:44:53 +01:00
Michael Vetter
014e03c72e Start working on MAM RSM to get more pages
Regards https://github.com/profanity-im/profanity/issues/660
2021-01-28 14:44:35 +01:00
Michael Vetter
a94378f206 Fix various typos 2020-12-10 09:24:32 +01:00
DebXWoody
15f45fcfe1 Fixed Date format for MAM request
Using g_date_time_new_now_utc instead of g_date_time_new_now_local
Using g_date_time_format(timestamp, "%FT%TZ") instead of "%FT%T%:::z"

Edit:
DebXWoody created this patch because ejabberd returned an error with the
old date format.
2020-10-28 09:06:49 +01: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
3cd3bced70
Incoming iq stanza - Reset the autoping timer
A autoping is to make sure that there is still a connection between server and
client. If the application receives incoming stanza, the connection is fine.
There is no need to wait for response, if there are other incomings.

Issue: #1333 and #1315
2020-05-23 06:52:03 +02:00
Michael Vetter
9c853d9f46 xep-0092: make it possible to ask servers or components for software
This adds the new `/serversoftware` command.

```
/software user@domain.org/resource
/serversoftware domain.org
```

Fix https://github.com/profanity-im/profanity/issues/1338
2020-05-14 19:13:27 +02:00
Michael Vetter
b9c384d6ca _iq_id_handler_free() dont set NULL
No effect here.
2020-04-20 16:17:09 +02:00
Michael Vetter
9be7d29f1b Don't expose upload_processes
That's actually not good practise.
Realized this when checking for multiple symbol definition in issue
mentioned below.

Regards https://github.com/profanity-im/profanity/issues/1314
2020-04-17 10:05:09 +02:00
Michael Vetter
616250b2b4 Review logging in iq.c 2020-04-14 18:53:08 +02:00
Michael Vetter
18c64c0580 Free timestamp correctly
g_date_time_add_days() actually creates a new one.
2020-04-13 10:04:37 +02:00
Michael Vetter
98200ebd43 Check if server suppors MAM 2020-04-12 00:24:00 +02:00
Michael Vetter
aedecee962 Get MAM since yesterday
Later we will have several options.
Getting everything since last timestamp (if none everything at all).
Getting everything since today + configure time (1 week).

Should also have a reload all command like conversations once you
cleared the history.

All MAM messages should be written into sql db.
And then probably displayed from there so that regular history works
too.
2020-04-12 00:06:36 +02:00
Michael Vetter
fe9b520c42 First MAM test
Send a request (which we can't handle yet) :-)

Regards https://github.com/profanity-im/profanity/issues/660
2020-04-11 16:05:14 +02:00
Michael Vetter
8112b8c84b Use proper OS names for OpenBSD and NetBSD 2020-03-09 11:24:14 +01:00
Dmitry Podgorny
d18ec23d0a Fix few memory leaks 2020-02-27 01:35:36 +02:00
Michael Vetter
8c34f2ce01 xep-0092: add config option to set whether OS is revealed
Default is on. `revail.os=false` in the `connection` section of the
config can disable it.
A command to configure this will follow.
2020-01-23 23:35:46 +01:00
Michael Vetter
cb1dbb2732 xep-0092: send OS too
So far we only sent client name and version. Let's also send the OS
name.
2020-01-23 23:18:55 +01:00
Michael Vetter
2d19ad0db4 Add option to notify about version request
Cannot be configured for now.
Can be set via `adv.notify.discoversion` in the `notification` section.

Will notify about version requests via XEP-0092 and XEP-0232.

Client version can still be seen via caps (capabilities).
See `stanza_attach_caps()`.
2020-01-23 22:54:47 +01:00
Michael Vetter
3066fd77fc Save MUC room name in ProfMucWin
We will need this if we want to display the Name instead of the JID.
2020-01-23 11:35:33 +01:00
Paul Fariello
84506cbaeb Use OMEMO for offline MUC members (#1242) 2020-01-20 14:28:13 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
ef19b45e64 Remove old comment
It's not up to date.
Some time ago we changed from individual handlers to general ones.
2019-10-21 10:28:29 +02:00
Michael Vetter
53640f6e97 Remove prefix from stanza id
We sent `prof_prefix_uuid` as id. Where the prefix was also optional.
We don't need this at all.
2019-10-17 15:40:40 +02:00
Paul Fariello
b3e59e1fb6 Fix memleak in /cmd exec 2019-07-30 13:35:08 +02:00
Paul Fariello
5e61bc08dd Fix command form submit
Command form userdata were freed by iq_id_handler.
We should now free the command ourself.
2019-07-30 10:22:57 +02:00
Michael Vetter
c07d533ec1 Fixup for last commit 2019-07-12 11:11:45 +02:00
Michael Vetter
68b6deefbf Fix segfault in iq_{submit,cancel}_command_config
Taken care of by the destructor.
2019-07-12 10:57:07 +02:00
Michael Vetter
f32827d70d Fix some more potential double frees
Regards https://github.com/profanity-im/profanity/issues/1148
2019-07-11 16:15:57 +02:00
Michael Vetter
89d8fc846e Fix double free in room id handler
Free is done in destructor now.
Regards https://github.com/profanity-im/profanity/issues/1148
2019-07-09 09:47:35 +02:00
Michael Vetter
b3bb62dcbd Fix double free regarding iq handlers 2019-07-08 15:58:40 +02:00
Michael Vetter
9aad2aa487 Free iq_id_handlers correctly
so far only the key part was freed. We also need to free the actual
handler.

Fix:
```
==21171== 1,128 bytes in 47 blocks are definitely lost in loss record
3,476 of 3,670
==21171==    at 0x483677F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21171==    by 0x434248: iq_id_handler_add (iq.c:265)
==21171==    by 0x4B122E: omemo_devicelist_request (omemo.c:46)
==21171==    by 0x4AC411: omemo_start_session (omemo.c:409)
==21171==    by 0x4AC37C: omemo_start_sessions (omemo.c:396)
==21171==    by 0x447881: sv_ev_roster_received (server_events.c:189)
==21171==    by 0x444019: roster_result_handler (roster.c:312)
==21171==    by 0x433FC2: _iq_handler (iq.c:202)
==21171==    by 0x5AF118E: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x5AEDBDA: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x5AFA43E: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x6818AA4: ??? (in /usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x681A3AB: ??? (in /usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x681D7EB: XML_ParseBuffer (in
/usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x5AF0A63: xmpp_run_once (in
/usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x432E5D: connection_check_events (connection.c:104)
==21171==    by 0x4323B3: session_process_events (session.c:255)
==21171==    by 0x42C097: prof_run (profanity.c:128)
==21171==    by 0x4B2627: main (main.c:172)
```
2019-07-04 14:25:53 +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
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
Paul Fariello
21ae946896 Handle MUC anonymous state when auto starting OMEMO
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.
2019-04-17 14:03:14 +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
2d28725c85 Rename ProfIdCallback into ProfIqCallback
Goal is to create other kind of callback no based on id cmp
2019-04-10 16:03:50 +02:00