Feat v0.5.2 chat surface (#32)
All checks were successful
CI/CD / detect-changes (push) Successful in 3s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m28s
CI/CD / test-sqlite (push) Successful in 2m42s
CI/CD / build-and-deploy (push) Successful in 1m8s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #32.
This commit is contained in:
2026-03-30 15:25:33 +00:00
committed by xcaliber
parent 7155aaf663
commit 6931b125a4
13 changed files with 1513 additions and 23 deletions

View File

@@ -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)