Feat v0.5.2 chat surface
Chat surface package (packages/chat/) with conversation list, message thread, compose bar, participant sidebar, create conversation dialog, typing indicators, read receipts, message editing, and message deletion. Built on chat-core library with realtime event subscriptions. Fix stale token login deadlock: REST client auth endpoints excluded from 401 retry loop, 8s defensive boot timeout on auth.boot(). Fix bundled package permissions: auto-grant with NULL granted_by and set status active on install. Switch docker-compose to named volume for remote Docker host compat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@ def _now():
|
||||
# Exported API (lib.require("chat-core"))
|
||||
# ═══════════════════════════════════════════════
|
||||
|
||||
def create(title, type="group", participants=None, creator_id=""):
|
||||
def create(title, type="group", participants=None, creator_id="", creator_display_name=""):
|
||||
"""Create a conversation and add initial participants.
|
||||
|
||||
Args:
|
||||
@@ -74,6 +74,7 @@ def create(title, type="group", participants=None, creator_id=""):
|
||||
type: "direct" or "group" (default "group")
|
||||
participants: list of dicts with {id, type?, display_name?, role?}
|
||||
creator_id: user ID of the creator (added as admin)
|
||||
creator_display_name: display name of the creator
|
||||
|
||||
Returns:
|
||||
dict with conversation data
|
||||
@@ -95,7 +96,7 @@ def create(title, type="group", participants=None, creator_id=""):
|
||||
"conversation_id": cid,
|
||||
"participant_id": _str(creator_id),
|
||||
"participant_type": "user",
|
||||
"display_name": "",
|
||||
"display_name": _str(creator_display_name),
|
||||
"role": "admin",
|
||||
"joined_at": "",
|
||||
})
|
||||
@@ -430,8 +431,9 @@ def _handle_create_conversation(req, user_id):
|
||||
title = _str(body.get("title", ""))
|
||||
conv_type = _str(body.get("type", "group"))
|
||||
participants_list = body.get("participants", [])
|
||||
creator_name = _str(body.get("creator_display_name", ""))
|
||||
|
||||
conv = create(title, conv_type, participants_list, user_id)
|
||||
conv = create(title, conv_type, participants_list, user_id, creator_name)
|
||||
return _resp(201, conv)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user