Browse Source

Added Userid fields to DataSession and DataSelf JSON documents.

pull/28/head
Simon Eisenmann 11 years ago committed by Simon Eisenmann
parent
commit
1195b39b11
  1. 25
      doc/CHANNELING-API.txt
  2. 6
      src/app/spreed-speakfreely-server/channeling.go

25
doc/CHANNELING-API.txt

@ -1,5 +1,5 @@
Spreed Speak Freely Channeling API v1.2.0 Spreed Speak Freely Channeling API v1.3.0
================================================= =================================================
(c)2014 struktur AG (c)2014 struktur AG
@ -85,6 +85,7 @@ Special purpose documents for channling
{ {
"Type": "Self", "Type": "Self",
"Id": "4", "Id": "4",
"Userid": "",
"Token": "some-very-long-string", "Token": "some-very-long-string",
"Version": "server-version-number", "Version": "server-version-number",
"Turn": { "Turn": {
@ -107,7 +108,8 @@ Special purpose documents for channling
Keys: Keys:
Type : Self (string) Type : Self (string)
Id : Channel id for this connection (string) Id : Channel id for this connection (string).
Userid : User id if this session belongs to an authenticated user. Else empty.
Token : Security token (string), to restablish connection with the same Token : Security token (string), to restablish connection with the same
session. Pass the value as URL query parameter t, to the websocket URL. session. Pass the value as URL query parameter t, to the websocket URL.
Version: Server version number. Use this to detect server upgrades. Version: Server version number. Use this to detect server upgrades.
@ -259,9 +261,7 @@ Additional types for session listing and notifications
{ {
"Type": "Left", "Type": "Left",
"Id": "5", "Id": "5"
"Ua": "",
"Status": null
} }
Joined Joined
@ -269,10 +269,13 @@ Additional types for session listing and notifications
{ {
"Type": "Joined", "Type": "Joined",
"Id": "7", "Id": "7",
"Userid": "u7",
"Ua": "Chrome 28", "Ua": "Chrome 28",
"Status": null "Status": null
} }
Note: The Userid field is only present if that session belongs to a known user.
Status Status
{ {
@ -313,26 +316,30 @@ Additional types for session listing and notifications
{ {
"Type": "Online", "Type": "Online",
"Id": "1", "Id": "1",
"Ua": "webrtc-publisher", "Ua": "Firefox 27",
"Status": null "Status": {...}
}, },
{ {
"Type": "Online", "Type": "Online",
"Id": "3", "Id": "3",
"Userid": "u3",
"Ua": "Chrome 28", "Ua": "Chrome 28",
"Status": null "Status": {...}
}, },
{ {
"Type": "Online", "Type": "Online",
"Id": "4", "Id": "4",
"Userid": "u4",
"Ua": "Chrome 28", "Ua": "Chrome 28",
"Status": null "Status": {...}
} }
], ],
"Index": 0, "Index": 0,
"Batch": 0 "Batch": 0
} }
Note: The Userid field is only present, if that session belongs to a known user.
Alive Alive
{ {

6
src/app/spreed-speakfreely-server/channeling.go

@ -48,6 +48,7 @@ type DataAnswer struct {
type DataSelf struct { type DataSelf struct {
Type string Type string
Id string Id string
Userid string
Token string Token string
Version string Version string
Turn *DataTurn Turn *DataTurn
@ -64,9 +65,10 @@ type DataTurn struct {
type DataSession struct { type DataSession struct {
Type string Type string
Id string Id string
Userid string `json:"Userid,omitempty"`
Ua string Ua string
Token string Token string `json:"Token,omitempty"`
Version string Version string `json:"Version,omitempty"`
Rev uint64 Rev uint64
Status interface{} Status interface{}
} }

Loading…
Cancel
Save