Skip to content

Commit

Permalink
legacymigrate: remove dot part in message senders
Browse files Browse the repository at this point in the history
Fixes #720
  • Loading branch information
tulir committed Oct 1, 2024
1 parent e099e60 commit dea5ae2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/mautrix-whatsapp/legacymigrate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ SELECT
mxid,
chat_jid, -- room_id
CASE WHEN chat_receiver LIKE '%@s.whatsapp.net' THEN replace(chat_receiver, '@s.whatsapp.net', '') ELSE '' END, -- room_receiver
CASE WHEN sender=chat_jid THEN '' ELSE split_part(replace(sender, '@s.whatsapp.net', ''), ':', 1) END, -- sender_id
CASE WHEN sender=chat_jid AND sender NOT LIKE '%@s.whatsapp.net'
THEN ''
ELSE split_part(split_part(replace(sender, '@s.whatsapp.net', ''), ':', 1), '.', 1)
END, -- sender_id
sender_mxid, -- sender_mxid
timestamp * 1000000000, -- timestamp TODO check multiplier
0, -- edit_count
Expand Down

0 comments on commit dea5ae2

Please sign in to comment.