Commit graph

16 commits

Author SHA1 Message Date
Darren Clarke
e941353b64 Repo cleanup 2026-02-10 08:36:04 +01:00
Darren Clarke
3d8f794cab Add user ID support for Baileys 7 LIDs and Signal UUIDs
Baileys 7 uses LIDs (Linked IDs) instead of phone numbers in remoteJid for
some messages. This caused messages to be matched to wrong tickets because
the LID was used as the sender identifier. This commit adds proper support
for both phone numbers and user IDs across WhatsApp and Signal channels.

Changes:

Database:
- Add migration for whatsapp_user_id and signal_user_id fields on users table

Zammad controllers:
- Update user lookup with 3-step fallback: phone → dedicated user_id field →
  user_id in phone field (legacy)
- Store user IDs in dedicated fields when available
- Update phone field when we receive actual phone number for legacy records
- Fix redundant condition in Signal controller

Bridge services:
- Extract both phone (from senderPn/participantPn) and LID (from remoteJid)
- Send both identifiers to Zammad via webhooks
- Use camelCase (userId) in bridge-whatsapp, convert to snake_case (user_id)
  in bridge-worker for Zammad compatibility

Baileys 7 compliance:
- Remove broken loadAllUnreadMessages() call (removed in Baileys 7)
- Return descriptive error directing users to use webhooks instead

Misc:
- Add docs/ to .gitignore
2026-01-15 13:08:56 +01:00
Darren Clarke
57f3ccbaeb Fetch message history at startup 2026-01-14 11:00:41 +01:00
Darren Clarke
e202eeb9d2 Remove deprecated property 2026-01-14 11:00:41 +01:00
Darren Clarke
e952973f7f Update Baileys to 7RC 2026-01-14 11:00:41 +01:00
Darren Clarke
31eb1d92b4 Fix for sending to WhatsApp user IDs 2025-12-04 13:40:04 +01:00
Darren Clarke
d0cc5a21de WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
Darren Clarke
8867f5ba6e Remove extra 'fromMe' condition in bridge-whatsapp 2024-07-25 10:27:11 +02:00
Darren Clarke
1512cca858 Fix Whatsapp link issue 2024-07-19 11:25:35 +02:00
Darren Clarke
c32c26088f Standardize bridge send/receive params 2024-07-18 11:08:01 +02:00
Darren Clarke
c729a46a0c Signal API updates 2024-06-05 15:12:48 +02:00
Darren Clarke
e26e5832ff More Whatsapp Docker updates 2024-05-17 09:20:00 +02:00
Darren Clarke
3da103c010 Whatsapp service updates 2024-05-16 18:22:10 +02:00
Darren Clarke
f6dc60eb08 Bridge whatsapp simplification 2024-05-15 14:39:33 +02:00
Darren Clarke
6305a8b0bc Add Signal and Whatsapp Docker CI 2024-05-15 10:27:14 +02:00
Darren Clarke
0499287555 Add bridge-whatsapp 2024-05-07 14:16:01 +02:00