feat: Implement Direct Messaging with new frontend components, user search, and backend read state management.
All checks were successful
Build and Release / build-and-release (push) Successful in 10m9s
All checks were successful
Build and Release / build-and-release (push) Successful in 10m9s
This commit is contained in:
@@ -50,6 +50,7 @@ export const listDMs = query({
|
||||
other_user_id: v.string(),
|
||||
other_username: v.string(),
|
||||
other_user_status: v.optional(v.string()),
|
||||
other_user_avatar_url: v.optional(v.union(v.string(), v.null())),
|
||||
})
|
||||
),
|
||||
handler: async (ctx, args) => {
|
||||
@@ -74,12 +75,17 @@ export const listDMs = query({
|
||||
const otherUser = await ctx.db.get(otherPart.userId);
|
||||
if (!otherUser) return null;
|
||||
|
||||
const avatarUrl = otherUser.avatarStorageId
|
||||
? await ctx.storage.getUrl(otherUser.avatarStorageId)
|
||||
: null;
|
||||
|
||||
return {
|
||||
channel_id: part.channelId,
|
||||
channel_name: channel.name,
|
||||
other_user_id: otherUser._id as string,
|
||||
other_username: otherUser.username,
|
||||
other_user_status: otherUser.status || "offline",
|
||||
other_user_avatar_url: avatarUrl,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user