Skip to content

Commit

Permalink
fix(signal) update to recent db schema(11, Jun2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis authored and karlicoss committed Aug 10, 2024
1 parent 6aae766 commit 61f1c47
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/promnesia/sources/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,18 @@ def index(
SELECT
id,
type,
coalesce(name, profileName, profileFamilyName, e164) as aname,
coalesce(
profileFullName,
profileName,
name,
profileFamilyName,
e164
) as aname,
name,
profileName,
profileFamilyName,
e164,
uuid
serviceId
FROM conversations
),
Msgs AS (
Expand All @@ -125,8 +131,8 @@ def index(
M.received_at,
M.sent_at
) AS timestamp,
IIF(M.type = "outgoing",
"Me (" || C2.aname || ")",
IIF(M.type = 'outgoing',
'Me (' || C2.aname || ')',
C2.aname
) AS sender,
M.conversationId AS cid,
Expand All @@ -140,7 +146,7 @@ def index(
INNER JOIN Cons AS C1
ON M.conversationId = C1.id
INNER JOIN Cons AS C2
ON M.sourceUuid = C2.uuid
ON M.sourceServiceId = C2.serviceId
)
SELECT id, timestamp, sender, cid, chatname, body
FROM Msgs
Expand Down

0 comments on commit 61f1c47

Please sign in to comment.