fix notification bugs - active_music_session vs. music_session confusion
This commit is contained in:
parent
7290188681
commit
e5a6ad862b
|
|
@ -512,10 +512,10 @@ module JamRuby
|
|||
user.photo_url,
|
||||
user.id,
|
||||
notification_msg,
|
||||
music_session.track_changes_counter
|
||||
music_session.active_music_session.track_changes_counter
|
||||
)
|
||||
|
||||
@@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => connection.client_id})
|
||||
@@mq_router.server_publish_to_session(music_session.active_music_session, msg, sender = {:client_id => connection.client_id})
|
||||
end
|
||||
|
||||
def send_session_depart(music_session, client_id, user, recordingId)
|
||||
|
|
@ -527,18 +527,18 @@ module JamRuby
|
|||
user.photo_url,
|
||||
notification_msg,
|
||||
recordingId,
|
||||
music_session.track_changes_counter
|
||||
music_session.active_music_session.track_changes_counter
|
||||
)
|
||||
|
||||
@@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id})
|
||||
@@mq_router.server_publish_to_session(music_session.active_music_session, msg, sender = {:client_id => client_id})
|
||||
end
|
||||
|
||||
def send_tracks_changed(music_session)
|
||||
msg = @@message_factory.tracks_changed(
|
||||
music_session.id, music_session.track_changes_counter
|
||||
music_session.id, music_session.active_music_session.track_changes_counter
|
||||
)
|
||||
|
||||
@@mq_router.server_publish_to_session(music_session, msg)
|
||||
@@mq_router.server_publish_to_session(music_session.active_music_session, msg)
|
||||
end
|
||||
|
||||
def send_musician_session_join(music_session, user)
|
||||
|
|
|
|||
|
|
@ -1178,7 +1178,7 @@
|
|||
|
||||
function onTermsAccepted(args) {
|
||||
deleteNotification(args.notification_id);
|
||||
sessionUtils.onJoinSessionTermsAccepted(args.session_id);
|
||||
context.location = '/client#/session/' + args.session_id;
|
||||
}
|
||||
|
||||
function rejectJoinRequest(args) {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
for (var i=0; i < session.invitations.length; i++) {
|
||||
invitation = session.invitations[i];
|
||||
// session contains an invitation for this user
|
||||
if (invitation.receiver_id === JK.currentUserId) {
|
||||
if (invitation.receiver_id === context.JK.currentUserId) {
|
||||
hasInvitation = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
if (session) {
|
||||
// if user has an invitation, always open terms and allow joining regardless of settings
|
||||
if (hasInvitation) {
|
||||
logger.debug("Found invitation for user " + JK.currentUserId + ", session " + sessionId);
|
||||
logger.debug("Found invitation for user " + context.JK.currentUserId + ", session " + sessionId);
|
||||
openJoinSessionTerms(sessionId);
|
||||
}
|
||||
else {
|
||||
|
|
@ -181,7 +181,7 @@
|
|||
}
|
||||
|
||||
function openJoinRequestAlert(sessionId) {
|
||||
var alertDialog = new context.JK.AlertDialog(JK.app, "YES",
|
||||
var alertDialog = new context.JK.AlertDialog(context.JK.app, "YES",
|
||||
"You must be approved to join this session. Would you like to send a request to join?",
|
||||
sessionId, onCreateJoinRequest);
|
||||
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
}
|
||||
|
||||
function sessionNotJoinableAlert() {
|
||||
var alertDialog = new context.JK.AlertDialog(JK.app, "OK",
|
||||
var alertDialog = new context.JK.AlertDialog(context.JK.app, "OK",
|
||||
"This session is over or is no longer public and cannot be joined. Please click Refresh to update the session list.",
|
||||
null,
|
||||
function(evt) {
|
||||
|
|
@ -202,13 +202,13 @@
|
|||
context.JK.app.layout.showDialog('alert');
|
||||
}
|
||||
|
||||
sessionUtils.openJoinSessionTerms = function(sessionId) {
|
||||
function openJoinSessionTerms(sessionId) {
|
||||
var termsDialog = new context.JK.TermsDialog(context.JK.app, sessionId, onJoinSessionTermsAccepted);
|
||||
termsDialog.initialize();
|
||||
context.JK.app.layout.showDialog('terms');
|
||||
}
|
||||
|
||||
sessionUtils.onJoinSessionTermsAccepted = function(sessionId) {
|
||||
function onJoinSessionTermsAccepted(sessionId) {
|
||||
context.location = '/client#/session/' + sessionId;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue