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 committed Jun 19, 2024
1 parent 47ae8c6 commit f1b02c4
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 @@ -105,12 +105,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 @@ -122,8 +128,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 @@ -137,7 +143,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 f1b02c4

Please sign in to comment.