Skip to content

Commit

Permalink
Restore the user_id property for fully resolved users
Browse files Browse the repository at this point in the history
When resolving a PeerUser to a full_user, resolve_groups will now re-insert the original user_id property in the generated dictionary (so the ID is always accessible at the same JSON path whether or not we chose to resolve references).  This mirrors the existing behaviour for resolving channels.
  • Loading branch information
ianroberts committed Aug 22, 2023
1 parent 2e69c67 commit 5060b96
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions datasources/telegram/search_telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ async def resolve_groups(self, client, message):
self.details_cache[value["user_id"]] = SearchTelegram.serialize_obj(user)

resolved_message[key] = self.details_cache[value["user_id"]]
resolved_message[key]["user_id"] = value["user_id"]
else:
resolved_message[key] = await self.resolve_groups(client, value)

Expand Down

0 comments on commit 5060b96

Please sign in to comment.