Skip to content

Commit 40a7711

Browse files
committed
Merge branch 'release-0.23'
2 parents 3324a6f + 488e08c commit 40a7711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+829
-2659
lines changed

.hound.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
java_script:
22
enabled: true
33
config_file: .jshint
4+
ignore_file: .javascript_ignore

.javascript_ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
static/js/libs/**.js

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,6 @@ The latest version of Spreed WebRTC can be found on GitHub:
108108
and CSS reload directly.
109109

110110

111-
## Branding
112-
113-
Insert logo in `static/img`. Edit `src/styles/global/_branding.scss` to link
114-
to desired custom logo. It is also possible to insert the raw svg data.
115-
116-
117-
## Skins
118-
119-
Insert skins in `src/styles/global/skins` and edit the `@import "skins/light";`
120-
line in `src/styles/global/_variables.scss`. Available skins are light and
121-
dark. It is recommended to create a new skin file if you wish to customize
122-
colors.
123-
124-
125111
## Running for production
126112

127113
Spreed WebRTC should be run through a SSL frontend proxy with

build/r.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
33
* Available via the MIT or new BSD license.
44
* see: http://github.com/jrburke/requirejs for details
55
*/
@@ -20,7 +20,7 @@ var requirejs, require, define, xpcUtil;
2020
(function (console, args, readFileFunc) {
2121
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
23-
version = '2.1.14',
23+
version = '2.1.15',
2424
jsSuffixRegExp = /\.js$/,
2525
commandOption = '',
2626
useLibLoaded = {},
@@ -238,7 +238,7 @@ var requirejs, require, define, xpcUtil;
238238
}
239239

240240
/** vim: et:ts=4:sw=4:sts=4
241-
* @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
241+
* @license RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
242242
* Available via the MIT or new BSD license.
243243
* see: http://github.com/jrburke/requirejs for details
244244
*/
@@ -251,7 +251,7 @@ var requirejs, require, define, xpcUtil;
251251
(function (global) {
252252
var req, s, head, baseElement, dataMain, src,
253253
interactiveScript, currentlyAddingScript, mainScript, subPath,
254-
version = '2.1.14',
254+
version = '2.1.15',
255255
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
256256
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
257257
jsSuffixRegExp = /\.js$/,
@@ -22949,7 +22949,7 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2294922949
//Like traverse, but skips if branches that would not be processed
2295022950
//after has application that results in tests of true or false boolean
2295122951
//literal values.
22952-
var key, child, result, i, params, param,
22952+
var key, child, result, i, params, param, tempObject,
2295322953
hasHas = options && options.has;
2295422954

2295522955
fnExpScope = fnExpScope || emptyScope;
@@ -22979,23 +22979,23 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2297922979

2298022980
//Build up a "scope" object that informs nested recurse calls if
2298122981
//the define call references an identifier that is likely a UMD
22982-
//wrapped function expresion argument.
22982+
//wrapped function expression argument.
2298322983
if (object.type === 'ExpressionStatement' && object.expression &&
2298422984
object.expression.type === 'CallExpression' && object.expression.callee &&
2298522985
object.expression.callee.type === 'FunctionExpression') {
22986-
object = object.expression.callee;
22987-
22988-
if (object.params && object.params.length) {
22989-
params = object.params;
22990-
fnExpScope = mixin({}, fnExpScope, true);
22991-
for (i = 0; i < params.length; i++) {
22992-
param = params[i];
22993-
if (param.type === 'Identifier') {
22994-
fnExpScope[param.name] = true;
22995-
}
22986+
tempObject = object.expression.callee;
22987+
22988+
if (tempObject.params && tempObject.params.length) {
22989+
params = tempObject.params;
22990+
fnExpScope = mixin({}, fnExpScope, true);
22991+
for (i = 0; i < params.length; i++) {
22992+
param = params[i];
22993+
if (param.type === 'Identifier') {
22994+
fnExpScope[param.name] = true;
2299622995
}
2299722996
}
2299822997
}
22998+
}
2299922999

2300023000
for (key in object) {
2300123001
if (object.hasOwnProperty(key)) {
@@ -23014,12 +23014,12 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2301423014
//wrapping.
2301523015
if (typeof result === 'string') {
2301623016
if (hasProp(fnExpScope, result)) {
23017-
//Just a plain return, parsing can continue past this
23018-
//point.
23019-
return;
23017+
//result still in scope, keep jumping out indicating the
23018+
//identifier still in use.
23019+
return result;
2302023020
}
2302123021

23022-
return result;
23022+
return;
2302323023
}
2302423024
}
2302523025
};
@@ -26539,7 +26539,8 @@ define('build', function (require) {
2653926539
"excludeShallow": true,
2654026540
"insertRequire": true,
2654126541
"stubModules": true,
26542-
"deps": true
26542+
"deps": true,
26543+
"mainConfigFile": true
2654326544
};
2654426545

2654526546
for (i = 0; i < ary.length; i++) {

debian/changelog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
spreed-webrtc-server (0.23.4) precise; urgency=low
2+
3+
* Cleanup of README.
4+
* Fixed a problem where videos were not sized correctly.
5+
* Lodash was updated to 3.0.0.
6+
* Server now has an option to require authentication to join rooms.
7+
* Screen sharing, youtube and presentation modules can now be disabled in server.conf.
8+
* Fixed position of buddy list loader animation.
9+
* Fixed loaded of anonymous user data when a plugin uses the authorization api.
10+
* Refactored session cleanup to fix ghost sessions.
11+
* Reorganization to allow better app support.
12+
* Updated require.js and r.js to 2.1.5.
13+
* Fixed room reset when default room is disabled.
14+
15+
-- Simon Eisenmann <[email protected]> Mon, 02 Feb 2015 17:18:53 +0100
16+
117
spreed-webrtc-server (0.23.3) precise; urgency=low
218

319
* Improved room bar room change and leave buttons.

html/main.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@
2222
<div class="navbar-collapse collapse" collapse="isCollapsed">
2323
<ul class="nav navbar-nav navbar-right right">
2424
<li class="ng-cloak">
25-
<button title="{{_('Share a YouTube video')}}" class="btn aenablebtn btn-youtubevideo" ng-show="status=='connected' || status=='conference' || layout.youtubevideo" ng-model="layout.youtubevideo" btn-checkbox><i class="fa fa-youtube"></i></button>
26-
<button title="{{_('Share a file as presentation')}}" class="btn aenablebtn btn-presentation" ng-show="status=='connected' || status=='conference' || layout.presentation" ng-model="layout.presentation" btn-checkbox><i class="fa fa-folder-open-o"></i></button>
27-
<button title="{{_('Share your screen')}}" class="btn aenablebtn btn-screenshare" ng-disabled="!supported.screensharing" ng-show="status=='connected' || status=='conference' || layout.screenshare" ng-model="layout.screenshare" btn-checkbox><i class="fa fa-desktop"></i></button>
28-
<button title="{{_('Chat')}}" class="btn btn-chat" ng-class="{messagesunseen: chatMessagesUnseen>0}" ng-model="layout.chat" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-comments-o"></i><span class="badge" ng-show="chatMessagesUnseen" ng-bind="chatMessagesUnseen"></span></button>
29-
<button ng-show="myid && myuserid" title="{{_('Contacts')}}" class="btn btn-contacts" ng-click="openContactsManager()"><i class="fa fa-sitemap"></i></button>
30-
<button title="{{_('Mute microphone')}}" class="btn btn-mutemicrophone amutebtn" ng-model="microphoneMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
31-
<button title="{{_('Turn camera off')}}" class="btn btn-mutecamera amutebtn" ng-model="cameraMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
32-
<button title="{{_('Settings')}}" class="btn btn-settings" ng-model="layout.settings" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-cog"></i></button>
25+
<menu></menu>
3326
</li>
3427
</ul>
3528
</div>

server.conf.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ encryptionSecret = tne-default-encryption-block-key
7878
; all users will join this room if enabled. If it is disabled then a room join
7979
; form will be shown instead.
8080
;defaultRoomEnabled = true
81+
; Whether a user account is required to join a room. This only has an effect
82+
; if user accounts are enabled. Optional, defaults to false.
83+
;authorizeRoomJoin = false
8184
; Whether a user account is required to create a room. This only has an effect
8285
; if user accounts are enabled. Optional, defaults to false.
8386
;authorizeRoomCreation = false
@@ -115,6 +118,13 @@ serverRealm = local
115118
; to test your CSP before putting it into production.
116119
;contentSecurityPolicyReportOnly =
117120

121+
[modules]
122+
; Modules provide optional functionality. Modules are enabled by default and
123+
; can be disabled by setting false to their corresponding configuration.
124+
;screensharing = true
125+
;youtube = true
126+
;presentation = true
127+
118128
[log]
119129
;logfile = /var/log/spreed-webrtc-server.log
120130

src/app/spreed-webrtc-server/channelling_api.go

Lines changed: 19 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ package main
2323

2424
import (
2525
"log"
26-
"strings"
2726
"time"
2827
)
2928

@@ -34,7 +33,6 @@ const (
3433
type ChannellingAPI interface {
3534
OnConnect(Client, *Session)
3635
OnIncoming(ResponseSender, *Session, *DataIncoming)
37-
OnDisconnect(*Session)
3836
}
3937

4038
type channellingAPI struct {
@@ -46,11 +44,9 @@ type channellingAPI struct {
4644
ContactManager
4745
TurnDataCreator
4846
Unicaster
49-
Broadcaster
50-
buddyImages ImageCache
5147
}
5248

53-
func NewChannellingAPI(config *Config, roomStatus RoomStatusManager, sessionEncoder SessionEncoder, sessionManager SessionManager, statsCounter StatsCounter, contactManager ContactManager, turnDataCreator TurnDataCreator, unicaster Unicaster, broadcaster Broadcaster, buddyImages ImageCache) ChannellingAPI {
49+
func NewChannellingAPI(config *Config, roomStatus RoomStatusManager, sessionEncoder SessionEncoder, sessionManager SessionManager, statsCounter StatsCounter, contactManager ContactManager, turnDataCreator TurnDataCreator, unicaster Unicaster) ChannellingAPI {
5450
return &channellingAPI{
5551
config,
5652
roomStatus,
@@ -60,8 +56,6 @@ func NewChannellingAPI(config *Config, roomStatus RoomStatusManager, sessionEnco
6056
contactManager,
6157
turnDataCreator,
6258
unicaster,
63-
broadcaster,
64-
buddyImages,
6559
}
6660
}
6761

@@ -77,40 +71,31 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
7771
case "Hello":
7872
//log.Println("Hello", msg.Hello, c.Index())
7973
// TODO(longsleep): Filter room id and user agent.
80-
api.UpdateSession(session, &SessionUpdate{Types: []string{"Ua"}, Ua: msg.Hello.Ua})
81-
if session.Hello && session.Roomid != msg.Hello.Id {
82-
api.LeaveRoom(session)
83-
api.Broadcast(session, session.DataSessionLeft("soft"))
84-
}
74+
session.Update(&SessionUpdate{Types: []string{"Ua"}, Ua: msg.Hello.Ua})
8575

76+
room, err := session.JoinRoom(msg.Hello.Id, msg.Hello.Credentials, c)
8677
// NOTE(lcooper): Iid filtered for compatibility's sake.
8778
// Evaluate sending unconditionally when supported by all clients.
88-
if room, err := api.JoinRoom(msg.Hello.Id, msg.Hello.Credentials, session, c); err == nil {
89-
session.Hello = true
90-
session.Roomid = msg.Hello.Id
91-
if msg.Iid != "" {
79+
if msg.Iid != "" {
80+
if err == nil {
9281
c.Reply(msg.Iid, &DataWelcome{
9382
Type: "Welcome",
9483
Room: room,
9584
Users: api.RoomUsers(session),
9685
})
97-
}
98-
api.Broadcast(session, session.DataSessionJoined())
99-
} else {
100-
session.Hello = false
101-
if msg.Iid != "" {
86+
} else {
10287
c.Reply(msg.Iid, err)
10388
}
10489
}
10590
case "Offer":
10691
// TODO(longsleep): Validate offer
107-
api.Unicast(session, msg.Offer.To, msg.Offer)
92+
session.Unicast(msg.Offer.To, msg.Offer)
10893
case "Candidate":
10994
// TODO(longsleep): Validate candidate
110-
api.Unicast(session, msg.Candidate.To, msg.Candidate)
95+
session.Unicast(msg.Candidate.To, msg.Candidate)
11196
case "Answer":
11297
// TODO(longsleep): Validate Answer
113-
api.Unicast(session, msg.Answer.To, msg.Answer)
98+
session.Unicast(msg.Answer.To, msg.Answer)
11499
case "Users":
115100
if session.Hello {
116101
sessions := &DataSessions{Type: "Users", Users: api.RoomUsers(session)}
@@ -125,27 +110,27 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
125110
if err := api.Authenticate(session, st, ""); err == nil {
126111
log.Println("Authentication success", session.Userid)
127112
api.SendSelf(c, session)
128-
api.BroadcastSessionStatus(session)
113+
session.BroadcastStatus()
129114
} else {
130115
log.Println("Authentication failed", err, st.Userid, st.Nonce)
131116
}
132117
case "Bye":
133-
api.Unicast(session, msg.Bye.To, msg.Bye)
118+
session.Unicast(msg.Bye.To, msg.Bye)
134119
case "Status":
135120
//log.Println("Status", msg.Status)
136-
api.UpdateSession(session, &SessionUpdate{Types: []string{"Status"}, Status: msg.Status.Status})
137-
api.BroadcastSessionStatus(session)
121+
session.Update(&SessionUpdate{Types: []string{"Status"}, Status: msg.Status.Status})
122+
session.BroadcastStatus()
138123
case "Chat":
139124
// TODO(longsleep): Limit sent chat messages per incoming connection.
140125
if !msg.Chat.Chat.NoEcho {
141-
api.Unicast(session, session.Id, msg.Chat)
126+
session.Unicast(session.Id, msg.Chat)
142127
}
143128
msg.Chat.Chat.Time = time.Now().Format(time.RFC3339)
144129
if msg.Chat.To == "" {
145130
// TODO(longsleep): Check if chat broadcast is allowed.
146131
if session.Hello {
147132
api.CountBroadcastChat()
148-
api.Broadcast(session, msg.Chat)
133+
session.Broadcast(msg.Chat)
149134
}
150135
} else {
151136
if msg.Chat.Chat.Status != nil && msg.Chat.Chat.Status.ContactRequest != nil {
@@ -159,10 +144,10 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
159144
api.CountUnicastChat()
160145
}
161146

162-
api.Unicast(session, msg.Chat.To, msg.Chat)
147+
session.Unicast(msg.Chat.To, msg.Chat)
163148
if msg.Chat.Chat.Mid != "" {
164149
// Send out delivery confirmation status chat message.
165-
api.Unicast(session, session.Id, &DataChat{To: msg.Chat.To, Type: "Chat", Chat: &DataChatMessage{Mid: msg.Chat.Chat.Mid, Status: &DataChatStatus{State: "sent"}}})
150+
session.Unicast(session.Id, &DataChat{To: msg.Chat.To, Type: "Chat", Chat: &DataChatMessage{Mid: msg.Chat.Chat.Mid, Status: &DataChatStatus{State: "sent"}}})
166151
}
167152
}
168153
case "Conference":
@@ -173,7 +158,7 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
173158
// Send conference update to anyone.
174159
for _, id := range msg.Conference.Conference {
175160
if id != session.Id {
176-
api.Unicast(session, id, msg.Conference)
161+
session.Unicast(id, msg.Conference)
177162
}
178163
}
179164
}
@@ -211,7 +196,7 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
211196
}
212197
case "Room":
213198
if room, err := api.UpdateRoom(session, msg.Room); err == nil {
214-
api.Broadcast(session, room)
199+
session.Broadcast(room)
215200
c.Reply(msg.Iid, room)
216201
} else {
217202
c.Reply(msg.Iid, err)
@@ -221,23 +206,6 @@ func (api *channellingAPI) OnIncoming(c ResponseSender, session *Session, msg *D
221206
}
222207
}
223208

224-
func (api *channellingAPI) OnDisconnect(session *Session) {
225-
dsl := session.DataSessionLeft("hard")
226-
if session.Hello {
227-
api.LeaveRoom(session)
228-
api.Broadcast(session, dsl)
229-
}
230-
231-
session.RunForAllSubscribers(func(session *Session) {
232-
log.Println("Notifying subscriber that we are gone", session.Id, session.Id)
233-
api.Unicast(session, session.Id, dsl)
234-
})
235-
236-
api.Unicaster.OnDisconnect(session)
237-
238-
api.buddyImages.Delete(session.Id)
239-
}
240-
241209
func (api *channellingAPI) SendSelf(c Responder, session *Session) {
242210
token, err := api.EncodeSessionToken(session)
243211
if err != nil {
@@ -259,26 +227,3 @@ func (api *channellingAPI) SendSelf(c Responder, session *Session) {
259227
}
260228
c.Reply("", self)
261229
}
262-
263-
func (api *channellingAPI) UpdateSession(session *Session, s *SessionUpdate) uint64 {
264-
if s.Status != nil {
265-
status, ok := s.Status.(map[string]interface{})
266-
if ok && status["buddyPicture"] != nil {
267-
pic := status["buddyPicture"].(string)
268-
if strings.HasPrefix(pic, "data:") {
269-
imageId := api.buddyImages.Update(session.Id, pic[5:])
270-
if imageId != "" {
271-
status["buddyPicture"] = "img:" + imageId
272-
}
273-
}
274-
}
275-
}
276-
277-
return session.Update(s)
278-
}
279-
280-
func (api *channellingAPI) BroadcastSessionStatus(session *Session) {
281-
if session.Hello {
282-
api.Broadcast(session, session.DataSessionStatus())
283-
}
284-
}

0 commit comments

Comments
 (0)