From e535d0401deab9438be2a1a9c56e42a3d9c30f4e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 17 Feb 2014 22:00:57 -0500 Subject: [PATCH] VRFS-546 use session settings to preselect band on create session --- pb/src/client_container.proto | 17 +++++++++-------- web/app/assets/javascripts/createSession.js.erb | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pb/src/client_container.proto b/pb/src/client_container.proto index ee046738a..0e54b3528 100644 --- a/pb/src/client_container.proto +++ b/pb/src/client_container.proto @@ -121,6 +121,7 @@ message ClientMessage { // band notifications optional BandInvitation band_invitation = 225; optional BandInvitationAccepted band_invitation_accepted = 230; + optional BandSessionJoin band_session_join = 235; optional MusicianSessionFresh musician_session_fresh = 240; optional MusicianSessionStale musician_session_stale = 245; @@ -302,14 +303,6 @@ message MusicianSessionJoin { optional string created_at = 5; } -message BandSessionJoin { - optional string session_id = 1; - optional string photo_url = 2; - optional string msg = 3; - optional string notification_id = 4; - optional string created_at = 5; -} - message MusicianRecordingSaved { optional string recording_id = 1; optional string photo_url = 2; @@ -365,6 +358,14 @@ message BandInvitationAccepted { optional string created_at = 5; } +message BandSessionJoin { + optional string session_id = 1; + optional string photo_url = 2; + optional string msg = 3; + optional string notification_id = 4; + optional string created_at = 5; +} + // route_to: client: // sent by server to let the rest of the participants know a client has become active again after going stale message MusicianSessionFresh { diff --git a/web/app/assets/javascripts/createSession.js.erb b/web/app/assets/javascripts/createSession.js.erb index 5d7006abe..4ea254cba 100644 --- a/web/app/assets/javascripts/createSession.js.erb +++ b/web/app/assets/javascripts/createSession.js.erb @@ -44,6 +44,9 @@ $('#musician-access-option-' + approval_required).iCheck('check').attr('checked', 'checked'); } + var bandId = sessionSettings.hasOwnProperty('band_id') ? sessionSettings.band_id : ''; + $('#band-list', $form).val(bandId); + var fan_access = sessionSettings.hasOwnProperty('fan_access') ? sessionSettings.fan_access : true; $('#fan-access option[value=' + fan_access + ']').attr('selected', 'selected'); toggleFanAccess();