Gateway protocol: pins, reactions, topics, events, streams, activity, admin
The new Voelin UI needs Discord-like features that TeamSpeak does not have. They run on tsgw, so the protocol grows, additively within v1: - capabilities in hello (server-wide) and auth_ok (per user, with admin) - query_history with before/after id and time cursors, optional limit, topic filter; sync by revision for new and changed messages - post (optionally into a topic), pins, reactions with per-user counts, topics, scheduled events with RSVP and reminders, the stream directory, the activity feed, runtime configuration and permission rules - history entries carry topic, reactions, pinned flag and revision; old clients ignore the extra fields Old clients never see a new message type: extension pushes need enable or a subscribe request. New error codes and enums have an unknown fallback so older clients keep parsing newer gateways. The optional client feature adds a typed client (request/answer by envelope id, typed pushes), shared by the app engine and the gateway's integration tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
1 parent
f0f1269812
commit
08071e7f43
8 files changed
+2016
-42
No files matched your search
@@ -127,13 +127,13 @@ impl Session {
|
||||
info!(uid = %user.uid, nickname = %user.nickname, "user logged in");
|
||||
let uid = user.uid.clone();
|
||||
self.user = Some(user);
|
||||
Ok(vec![ServerMsg::AuthOk { uid, token, token_expires }])
|
||||
Ok(vec![ServerMsg::AuthOk { uid, token, token_expires, capabilities: Vec::new() }])
|
||||
}
|
||||
ClientMsg::Resume { token, .. } => {
|
||||
let (user, token, token_expires) = self.hub.resume(&token).await?;
|
||||
let uid = user.uid.clone();
|
||||
self.user = Some(user);
|
||||
Ok(vec![ServerMsg::AuthOk { uid, token, token_expires }])
|
||||
Ok(vec![ServerMsg::AuthOk { uid, token, token_expires, capabilities: Vec::new() }])
|
||||
}
|
||||
ClientMsg::SubscribePresence => {
|
||||
self.user()?;
|
||||
@@ -204,7 +204,7 @@ impl Session {
|
||||
.history(&target, before, limit.min(200))
|
||||
.map_err(|e| Denied(ErrorCode::Internal, e.to_string()))?
|
||||
.into_iter()
|
||||
.map(|(id, message)| HistoryEntry { id, message })
|
||||
.map(|(id, message)| HistoryEntry::new(id, message))
|
||||
.collect();
|
||||
Ok(vec![ServerMsg::History { messages }])
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user