1
0
Fork 0
Commit Graph

141 Commits

Author SHA1 Message Date
nicoco 6c44ea555d fix: logout command 2024-04-30 20:31:11 +02:00
Alex Palaistras 1275ef55d1 Don't update presence status if not needed
Status messages are sent with every presence update by some XMPP
clients, which would previously result in corresponding changes being
made on the WhatsApp side, where no effective change in status has been
made since.

This commit implements naive caching for presence status in order to
avoid most double-sets, but which however will clear across restarts.
2024-04-30 18:21:52 +01:00
Alex Palaistras f2b4997473 Update Go dependencies 2024-04-29 21:21:17 +01:00
nicoco 8cdf2b9d7b dev: set --dev-mode for dev container
and show thread name in log records
2024-04-29 20:14:13 +02:00
nicoco 3fc0420e49 chore: update poetry.lock 2024-04-29 20:13:26 +02:00
Alex Palaistras e0c7c5c13d Ignore Broadcast and Status messages
Status messages and Broadcasts require special handling on the Slidge
side, especially where read receipts are concerned. However, if not
handled specifically, these will currently default to being handled
as (strange) group-chats, which might be responsible for crashes etc.

This commit has these message types be explicitly unhandled until we
introduce support for handling these properly.
2024-04-18 11:37:24 +01:00
nicoco 72ebb936d2 fix: mention of unknown contacts from whatsapp
It may happen that a participant who hasn't shared
their "push name" with us is mentioned in a chat by
another participant.
Before this fix, this would result in replacing the mention
with an empty string.
2024-03-25 09:00:35 +01:00
nicoco 0c5a4787f8 chore: update poetry.lock 2024-03-24 14:07:04 +01:00
nicoco 14a584e9a6 fix: allow moderators to modify room config
...by making them "XMPP owners"
2024-03-24 14:03:19 +01:00
Alex Palaistras 1f6c7ac4ab Update dependencies 2024-03-23 11:40:20 +00:00
nicoco 53eed92530 chore: update poetry.lock
Fixes: https://todo.sr.ht/~nicoco/slidge-whatsapp/29
2024-03-02 06:31:30 +01:00
nicoco c4af612543 fix: do not set subject in rooms without description
Setting the subject in rooms that don't have one
resulted in an empty subject with a timestamp of
'0001-01-01T00:00:00Z', which in turned raise warnings
in gajim's logs.

This commit changes the behaviour setting a subject
and a subject date only if they are given by WA's
servers.
2024-03-02 06:28:35 +01:00
nicoco d32f1f0a9e fix: check that oldest_message_id is not None in MUC.backfill()
does not seem to trigger any issue but mypy does not like it

also, paint it newer black
2024-03-02 06:28:35 +01:00
Alex Palaistras 59957fd436 Update to latest versions of dependencies 2024-02-26 18:10:33 +00:00
Alex Palaistras 9caf826b0b Implement history sync on first login
This commit implements history synchronization/back-fill on first login,
as allowed by WhatsApp. Currently, only history for group-chats/MUCs is
allowed, as 1:1 history synchronization is not operational without core
changes/support/privileges for the user's MAM.

In addition, even though on-demand backfills have been implemented, they
are considered to be inert/of limited use until persistent message
storage is implemented, as the `session.muc_sent_msg_ids` storage
currently utilized is in-memory only, and WhatsApp requires full message
metadata for on-demand history synchronization.
2024-02-23 17:09:33 +00:00
nicoco ae21c6f365 ci: install golang from bookworm-backports 2024-02-17 14:57:33 +01:00
nicoco e3c36becdc feat: group creation and affiliation changes 2024-02-17 14:51:10 +01:00
nicoco 4c88f75a88 doc: point to raver's dockerhub for arm64 containers 2024-02-17 14:50:01 +01:00
nicoco c745aa4050 chore: update entrypoint 2024-02-17 14:49:38 +01:00
nicoco 065252fba4 chore: update DOAP 2024-02-17 14:49:28 +01:00
nicoco 34f1c0c47d feat: add emojis in adhoc command names
Arguably, it looks a bit better in XMPP clients this way
2024-02-17 09:32:18 +01:00
nicoco 8879489b80 fix: whatsapp message retractions in direct chats 2024-02-17 09:30:56 +01:00
nicoco af1149313b chore: update go dependencies 2024-02-17 09:30:56 +01:00
nicoco e696691d68 chore: update poetry.lock 2024-02-17 09:30:56 +01:00
nicoco 6727da086a feat: bridge XMPP mentions as proper whatsapp mentions
This has outgoing mentions of participant usernames in MUCs be correctly
represented as mentions in official WhatsApp clients.
2024-02-17 08:44:03 +01:00
Alex Palaistras c40c9747e4 Bump voice message bit-rate to 64k
This helps improve quality, and appears to be well-supported by official
WhatsApp clients. In addition, a bug concerning the handling of ALAC
files has been fixed (which would previously not send through correctly,
owing to WhatsApp's lack of handling for these).
2024-02-16 22:11:59 +00:00
nicoco 7b87bfe29a feat: moderate messages from WhatsApp
Implements: https://todo.sr.ht/~nicoco/slidge-whatsapp/19
2024-02-11 07:01:44 +01:00
nicoco 0bf051a7d6 feat: moderate messages from XMPP
Includes a fix for the role of admin and
owner to "moderator", or else gajim wouldn't
display the option to actually moderate a
message.

Implements: https://todo.sr.ht/~nicoco/slidge-whatsapp/21
2024-02-11 07:01:44 +01:00
nicoco 69a4e27395 feat: set group name and topic
Implements: https://todo.sr.ht/~nicoco/slidge-whatsapp/24
2024-02-11 07:01:44 +01:00
nicoco 6440e97331 style: paint it newer black 2024-02-11 07:01:44 +01:00
nicoco e404bc09fe chore: update poetry.lock 2024-02-11 07:01:44 +01:00
Alex Palaistras f5f845043a Fix help text for `subscribe` command 2024-02-10 17:58:29 +00:00
Alex Palaistras ba1cbbafe3 Re-implement `subscribe` command
This allows for re-subscribing to contact presences without returning
the large response for the `contacts` command.
2024-02-10 17:53:57 +00:00
nicoco 923db9cba2 chore: update poetry.lock 2024-01-21 21:34:01 +01:00
nicoco 7f12bb4179 feat: set group avatar 2024-01-22 09:29:16 +01:00
nicoco 662d7c63fe fix: signature of on_correct() and on_text() 2024-01-19 22:06:56 +01:00
nicoco ecd393fe83 chore: update poetry.lock 2024-01-19 21:23:08 +01:00
nicoco 2c94a133a6 chore: update poetry.lock 2024-01-17 09:33:12 +01:00
nicoco 2c92f06d68 fix: adjust signature of BaseSession.on_correct() 2024-01-17 09:33:12 +01:00
Alex Palaistras 677fffa0c2 attachment: Fix incorrect use of detected MIME 2024-01-10 23:56:14 +00:00
Alex Palaistras fe82c63b1e Use detected MIME type in attachment conversion
Previously, we would rely on the client-reported MIME type, unless this
was empty or invalid, in making the determination of whether we
should (or not) convert a given attachment to a better-supported format.
However, client support for MIME type reporting is sporadic,
error-prone, and known-to-be-buggy in some cases (e.g. Conversations
reporting MP4 voice recordings as `audio/mpeg`).

This commit moves to using auto-detected MIME types for attachment
conversions, and adds some additional matching for known edge-cases.
In general, attachments will now have their MIME type, as presented to
WhatsApp, changed *only* if conversion takes place; the only exception
is when an empty or invalid MIME type was self-reported.
2024-01-07 19:48:29 +00:00
Alex Palaistras 3713cfe7ad Allow for disconnecting from WhatsApp with command
This commit introduces a new ad-hoc command, `logout`, which disconnects
from WhatsApp without unlinking our authentication credentials (i.e.
what is generally understood to be meant when saying "log out").
2024-01-07 16:13:42 +00:00
Alex Palaistras 3ca6948639 Update to latest Slidge core version
This also renames `Session` event handlers for corresponding changes in
core, and cleans up some "private" methods for better consistency.
2024-01-07 16:09:32 +00:00
Alex Palaistras f4ecbee5d2 Implement search by phone number
Searching by phone number will check for a contact on WhatsApp, and if
existing, automatically add that contact to the roster. However, contact
names are not resolved until after they've been added to the roster and
been communicated with.
2023-12-18 14:02:51 +01:00
nicoco 5ee1a02463 chore: update poetry.lock 2023-12-17 10:34:14 +01:00
Alex Palaistras 7eedd28d28 Update to latest GoPy version, fix issues
This fixes issues related to breaking changes in latest versions of
GoPy, which will now return concrete instances of corresponding classes
in iterators; previously, only a "pointer" would be returned, which
would've then needed to be set as the handle for a newly created
instance of a relevant class.

Closes: #17
2023-12-14 18:57:27 +00:00
Alex Palaistras ce1526bc6d Pin installed GoPy versions to 0.4.7
GoPy 0.4.8 and beyond introduce breaking changes related types returned
in function calls (e.g. slice element types). Previously, these would be
a pointer handle which would then need to be set into a concrete
instance of the type required by callers; GoPy will now return concrete
instances itself.

Moving to the new semantics requires changes to code, and additional
testing; pinning the version helps us migrate on our own timeline.
2023-12-14 13:49:39 +00:00
nicoco c225a899cd chore: update poetry.lock 2023-12-14 07:39:42 +01:00
Alex Palaistras 61db123ace Update dependencies, implement stub validation
Stub validation for our `Gateway` class is required in completing
registration, even though we don't process any forms.
2023-12-12 17:25:19 +00:00
nicoco 64f23f03e2 fix: group avatar unset 2023-12-11 22:35:36 +01:00