VRFS-1052 fix timestamp issue with notifications (moved to timeago plugin)
This commit is contained in:
parent
76e7a873ba
commit
667c629c27
|
|
@ -19,6 +19,10 @@ module JamRuby
|
|||
Notification.where(:target_user_id => user_id).limit(50)
|
||||
end
|
||||
|
||||
def created_date
|
||||
self.created_at.getutc.iso8601.to_s
|
||||
end
|
||||
|
||||
def photo_url
|
||||
unless self.source_user.nil?
|
||||
self.source_user.photo_url
|
||||
|
|
@ -224,7 +228,7 @@ module JamRuby
|
|||
user.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(friend_id, msg)
|
||||
|
|
@ -252,7 +256,7 @@ module JamRuby
|
|||
friend.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(user.id, msg)
|
||||
|
|
@ -279,7 +283,7 @@ module JamRuby
|
|||
follower.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(user.id, msg)
|
||||
|
|
@ -313,7 +317,7 @@ module JamRuby
|
|||
follower.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(bm.user_id, msg)
|
||||
|
|
@ -342,7 +346,7 @@ module JamRuby
|
|||
session_id,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(receiver.id, msg)
|
||||
|
|
@ -383,7 +387,7 @@ module JamRuby
|
|||
join_request.user.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(music_session.creator.id, msg)
|
||||
|
|
@ -406,7 +410,7 @@ module JamRuby
|
|||
music_session.creator.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(join_request.user.id, msg)
|
||||
|
|
@ -429,7 +433,7 @@ module JamRuby
|
|||
music_session.creator.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(join_request.user.id, msg)
|
||||
|
|
@ -498,7 +502,6 @@ module JamRuby
|
|||
notification.save
|
||||
|
||||
if ff.online
|
||||
puts "******************SENDING NOTIFICATION TO #{ff.name}******************"
|
||||
msg = @@message_factory.musician_session_join(
|
||||
ff.id,
|
||||
music_session.id,
|
||||
|
|
@ -508,7 +511,7 @@ module JamRuby
|
|||
music_session.approval_required,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(ff.id, msg)
|
||||
|
|
@ -546,7 +549,6 @@ module JamRuby
|
|||
notification.save
|
||||
|
||||
if follower.online
|
||||
puts "******************SENDING NOTIFICATION TO #{follower.name}******************"
|
||||
msg = @@message_factory.band_session_join(
|
||||
follower.id,
|
||||
music_session.id,
|
||||
|
|
@ -556,7 +558,7 @@ module JamRuby
|
|||
music_session.approval_required,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(follower.id, msg)
|
||||
|
|
@ -602,7 +604,7 @@ module JamRuby
|
|||
user.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(ff.id, notification_msg)
|
||||
|
|
@ -637,7 +639,7 @@ module JamRuby
|
|||
band.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(of.id, notification_msg)
|
||||
|
|
@ -700,7 +702,13 @@ module JamRuby
|
|||
|
||||
notification_msg = format_msg(notification.description, nil, recording.band)
|
||||
|
||||
msg = @@message_factory.recording_master_mix_complete(claimed_recording.user_id, recording.id, notification.band_id, notification_msg, notification.id, notification.created_at.to_s)
|
||||
msg = @@message_factory.recording_master_mix_complete(
|
||||
claimed_recording.user_id,
|
||||
recording.id,
|
||||
notification.band_id,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_date)
|
||||
|
||||
@@mq_router.publish_to_user(claimed_recording.user_id, msg)
|
||||
end
|
||||
|
|
@ -726,7 +734,7 @@ module JamRuby
|
|||
sender.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
|
||||
@@mq_router.publish_to_user(receiver.id, msg)
|
||||
|
|
@ -754,7 +762,7 @@ module JamRuby
|
|||
sender.photo_url,
|
||||
notification_msg,
|
||||
notification.id,
|
||||
notification.created_at.to_s
|
||||
notification.created_date
|
||||
)
|
||||
@@mq_router.publish_to_user(receiver.id, msg)
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@
|
|||
sessionId: val.sessionId,
|
||||
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
|
||||
text: val.formatted_msg,
|
||||
date: context.JK.formatDateTime(val.created_at)
|
||||
date: $.timeago(val.created_at)
|
||||
});
|
||||
|
||||
$('#sidebar-notification-list').append(notificationHtml);
|
||||
|
|
@ -363,7 +363,7 @@
|
|||
sessionId: payload.session_id,
|
||||
avatar_url: context.JK.resolveAvatarUrl(payload.photo_url),
|
||||
text: sidebarText,
|
||||
date: context.JK.formatDateTime(payload.created_at)
|
||||
date: $.timeago(payload.created_at)
|
||||
});
|
||||
|
||||
$('#sidebar-notification-list').prepend(notificationHtml);
|
||||
|
|
|
|||
|
|
@ -201,8 +201,8 @@
|
|||
<li session-id="{sessionId}" notification-id="{notificationId}">
|
||||
<div class="avatar-small"><img src="{avatar_url}" /></div>
|
||||
<div class="note-text">
|
||||
{text}
|
||||
<em>({date})</em>
|
||||
{text}
|
||||
<em>{date}</em>
|
||||
<div class="note-delete">
|
||||
<a>
|
||||
<img id="img-delete-notification" notification-id="{notificationId}" src="/assets/shared/icon_delete_sm.png" width="13" height="13" />
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ MusicSessionManager < BaseManager
|
|||
user.update_progression_field(:first_music_session_at)
|
||||
MusicSessionUserHistory.save(music_session.id, user.id, client_id, tracks)
|
||||
|
||||
# only send this notification if it's a band session AND there is either fan or musician access
|
||||
# only send this notification if it's a band session
|
||||
unless band.nil?
|
||||
Notification.send_band_session_join(music_session, band)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue