merge conflict

This commit is contained in:
Jonathan Kolyer 2014-03-08 20:50:51 +00:00
commit 713344a7a7
34 changed files with 210 additions and 89 deletions

View File

@ -222,7 +222,7 @@ ActiveAdmin.register_page "Bootstrap" do
elsif IcecastMountTemplate.count == 0
semantic_form_for IcecastMountTemplate.new, :url => admin_bootstrap_create_mount_template_path, :builder => ActiveAdmin::FormBuilder do |f|
f.inputs "New Mount Template" do
f.input :hostname, :label => "UNUSED?? jam-web public hostname:port (such that icecast can reach it)"
f.input :hostname, :label => "jam-web public hostname:port (such that icecast can reach it)"
f.input :default_mime_type, :as => :select, :collection => ["ogg", "mp3"]
end
f.actions

View File

@ -127,4 +127,5 @@ scores_mod_users2.sql
user_bio.sql
track_changes_counter.sql
scores_better_test_data.sql
plays_refactor.sql
connection_client_type.sql
add_countries_regions_and_cities.sql

View File

@ -0,0 +1,8 @@
create table cities (city varchar(255) not null, region varchar(2) not null, regionname varchar(64), countrycode varchar(2) not null, countryname varchar(64));
insert into cities (city, region, countrycode) select distinct city, region, countrycode from geoiplocations where length(city) > 0 and length(countrycode) > 0;
create table regions (region varchar(2) not null, regionname varchar(64), countrycode varchar(2) not null);
insert into regions (region, countrycode) select distinct region, countrycode from cities;
create table countries (countrycode varchar(2) not null, countryname varchar(64));
insert into countries (countrycode) select distinct countrycode from regions;

View File

@ -0,0 +1,3 @@
ALTER TABLE connections ADD COLUMN client_type VARCHAR(256);
UPDATE connections SET client_type = 'old' WHERE client_type IS NULL;
ALTER TABLE connections ALTER COLUMN client_type SET NOT NULL;

View File

@ -164,7 +164,7 @@ message Login {
optional string token = 3; // a token/cookie from previous successful login attempt or from 'token' field in .music file
optional string client_id = 4; // if supplied, the server will accept this client_id as the unique Id of this client instance
optional string reconnect_music_session_id = 5; // if supplied, the server will attempt to log the client into this session (designed for reconnect scenarios while in-session)
optional string client_type = 6; // 'client', 'browser'
}
// route_to: client

View File

@ -204,7 +204,11 @@ SQL
# this number is used by notification logic elsewhere to know
# 'oh the user joined for the 1st time, so send a friend update', or
# 'don't bother because the user has connected somewhere else already'
def create_connection(user_id, client_id, ip_address, &blk)
def create_connection(user_id, client_id, ip_address, client_type, &blk)
# validate client_type
raise "invalid client_type: #{client_type}" if client_type != 'client' && client_type != 'browser'
count = 0
ConnectionManager.active_record_transaction do |connection_manager|
conn = connection_manager.pg_conn
@ -242,8 +246,8 @@ SQL
lock_connections(conn)
conn.exec("INSERT INTO connections (user_id, client_id, ip_address, addr, locidispid, latitude, longitude, countrycode, region, city, aasm_state) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
[user_id, client_id, ip_address, addr, locidispid, latitude, longitude, countrycode, region, city, Connection::CONNECT_STATE.to_s]).clear
conn.exec("INSERT INTO connections (user_id, client_id, ip_address, client_type, addr, locidispid, latitude, longitude, countrycode, region, city, aasm_state) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)",
[user_id, client_id, ip_address, client_type, addr, locidispid, latitude, longitude, countrycode, region, city, Connection::CONNECT_STATE.to_s]).clear
# we just created a new connection-if this is the first time the user has shown up, we need to send out a message to his friends
conn.exec("SELECT count(user_id) FROM connections WHERE user_id = $1", [user_id]) do |result|

View File

@ -14,6 +14,7 @@ module JamRuby
validates :as_musician, :inclusion => {:in => [true, false]}
validates :client_type, :inclusion => {:in => ['client', 'browser']}
validate :can_join_music_session, :if => :joining_session?
after_save :require_at_least_one_track_when_in_session, :if => :joining_session?
after_create :did_create

View File

@ -38,10 +38,15 @@ module JamRuby
validates :template, presence: true
validates :mount_template, presence: true
before_validation :before_validate
before_save :before_save, unless: lambda { skip_config_changed_flag }
before_save :sanitize_active_admin
after_save :after_save
def before_validate
self.server_id = self.hostname
end
def before_save
self.config_changed = 1
end

View File

@ -568,7 +568,7 @@ module JamRuby
end
# send email notifications
if !offline_ff.empty? && music_session.fan_access
if !offline_followers.empty? && music_session.fan_access
UserMailer.band_session_join(offline_followers.map! {|f| f.email}, notification_msg, music_session.id).deliver if APP_CONFIG.send_join_session_email_notifications
end
end

View File

@ -96,6 +96,7 @@ FactoryGirl.define do
countrycode 'US'
region 'TX'
city 'Austin'
client_type 'client'
end
factory :invitation, :class => JamRuby::Invitation do

View File

@ -53,8 +53,8 @@ describe ConnectionManager do
user.save!
user = nil
@connman.create_connection(user_id, client_id, "1.1.1.1")
expect { @connman.create_connection(user_id, client_id, "1.1.1.1") }.to raise_error(PG::Error)
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
expect { @connman.create_connection(user_id, client_id, "1.1.1.1", 'client') }.to raise_error(PG::Error)
end
it "create connection then delete it" do
@ -63,7 +63,7 @@ describe ConnectionManager do
#user_id = create_user("test", "user2", "user2@jamkazam.com")
user = FactoryGirl.create(:user)
count = @connman.create_connection(user.id, client_id, "1.1.1.1")
count = @connman.create_connection(user.id, client_id, "1.1.1.1", 'client')
count.should == 1
@ -98,7 +98,7 @@ describe ConnectionManager do
#user_id = create_user("test", "user2", "user2@jamkazam.com")
user = FactoryGirl.create(:user)
count = @connman.create_connection(user.id, client_id, "1.1.1.1")
count = @connman.create_connection(user.id, client_id, "1.1.1.1", 'client')
count.should == 1
@ -151,12 +151,12 @@ describe ConnectionManager do
# friend_update = @message_factory.friend_update(user_id, true)
# @connman.mq_router.should_receive(:publish_to_friends).with([], friend_update, user_id)
# @connman.create_connection(user_id, client_id, "1.1.1.1")
# @connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
# # but a second connection from the same user should cause no such message
# @connman.should_receive(:publish_to_friends).exactly(0).times
# @connman.create_connection(user_id, client_id2, "1.1.1.1")
# @connman.create_connection(user_id, client_id2, "1.1.1.1", 'client')
# end
@ -170,8 +170,8 @@ describe ConnectionManager do
# # we should get a message saying that this user is online
# @connman.create_connection(user_id, client_id, "1.1.1.1")
# @connman.create_connection(user_id, client_id2, "1.1.1.1")
# @connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
# @connman.create_connection(user_id, client_id2, "1.1.1.1", 'client')
# # deleting one of the two connections should cause no messages
# @connman.should_receive(:publish_to_friends).exactly(0).times
@ -237,7 +237,7 @@ describe ConnectionManager do
it "flag stale connection" do
client_id = "client_id8"
user_id = create_user("test", "user8", "user8@jamkazam.com")
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
num = JamRuby::Connection.count(:conditions => ['aasm_state = ?','connected'])
num.should == 1
@ -271,11 +271,11 @@ describe ConnectionManager do
it "expires stale connection" do
client_id = "client_id8"
user_id = create_user("test", "user8", "user8@jamkazam.com")
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
sleep(1)
@connman.flag_stale_connections(1)
assert_num_connections(client_id, 1)
assert_num_connections(client_id, 1)
# assert_num_connections(client_id, JamRuby::Connection.count(:conditions => ['aasm_state = ?','stale']))
@connman.expire_stale_connections(60)
@ -296,11 +296,11 @@ describe ConnectionManager do
user = User.find(user_id)
music_session = MusicSession.find(music_session_id)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
connection.errors.any?.should be_false
assert_session_exists(music_session_id, true)
@conn.exec("SELECT music_session_id FROM connections WHERE client_id = $1", [client_id]) do |result|
@ -332,8 +332,8 @@ describe ConnectionManager do
client_id2 = "client_id10.12"
user_id = create_user("test", "user10.11", "user10.11@jamkazam.com", :musician => true)
user_id2 = create_user("test", "user10.12", "user10.12@jamkazam.com", :musician => false)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id2, client_id2, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
@connman.create_connection(user_id2, client_id2, "1.1.1.1", 'client')
music_session_id = create_music_session(user_id)
@ -352,7 +352,7 @@ describe ConnectionManager do
it "as_musician is coerced to boolean" do
client_id = "client_id10.2"
user_id = create_user("test", "user10.2", "user10.2@jamkazam.com", :musician => false)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
music_session_id = create_music_session(user_id)
@ -370,8 +370,8 @@ describe ConnectionManager do
fan_client_id = "client_id10.4"
musician_id = create_user("test", "user10.3", "user10.3@jamkazam.com")
fan_id = create_user("test", "user10.4", "user10.4@jamkazam.com", :musician => false)
@connman.create_connection(musician_id, musician_client_id, "1.1.1.1")
@connman.create_connection(fan_id, fan_client_id, "1.1.1.1")
@connman.create_connection(musician_id, musician_client_id, "1.1.1.1", 'client')
@connman.create_connection(fan_id, fan_client_id, "1.1.1.1", 'client')
music_session_id = create_music_session(musician_id, :fan_access => false)
@ -383,7 +383,7 @@ describe ConnectionManager do
# now join the session as a fan, bt fan_access = false
user = User.find(fan_id)
connection = @connman.join_music_session(user, fan_client_id, music_session, false, TRACKS)
connection.errors.size.should == 1
connection.errors.size.should == 1
end
it "join_music_session fails if incorrect user_id specified" do
@ -396,7 +396,7 @@ describe ConnectionManager do
user = User.find(user_id2)
music_session = MusicSession.find(music_session_id)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
# specify real user id, but not associated with this session
expect { @connman.join_music_session(user, client_id, music_session, true, TRACKS) } .to raise_error(ActiveRecord::RecordNotFound)
end
@ -408,7 +408,7 @@ describe ConnectionManager do
user = User.find(user_id)
music_session = MusicSession.new
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
connection.errors.size.should == 1
connection.errors.get(:music_session).should == [ValidationMessages::MUSIC_SESSION_MUST_BE_SPECIFIED]
@ -423,7 +423,7 @@ describe ConnectionManager do
user = User.find(user_id2)
music_session = MusicSession.find(music_session_id)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
# specify real user id, but not associated with this session
expect { @connman.join_music_session(user, client_id, music_session, true, TRACKS) } .to raise_error(ActiveRecord::RecordNotFound)
end
@ -437,7 +437,7 @@ describe ConnectionManager do
user = User.find(user_id)
dummy_music_session = MusicSession.new
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
expect { @connman.leave_music_session(user, Connection.find_by_client_id(client_id), dummy_music_session) }.to raise_error(JamRuby::StateError)
end
@ -453,7 +453,7 @@ describe ConnectionManager do
dummy_music_session = MusicSession.new
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
@connman.join_music_session(user, client_id, music_session, true, TRACKS)
expect { @connman.leave_music_session(user, Connection.find_by_client_id(client_id), dummy_music_session) }.to raise_error(JamRuby::StateError)
end
@ -467,7 +467,7 @@ describe ConnectionManager do
user = User.find(user_id)
music_session = MusicSession.find(music_session_id)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
@connman.join_music_session(user, client_id, music_session, true, TRACKS)
assert_session_exists(music_session_id, true)
@ -497,11 +497,11 @@ describe ConnectionManager do
music_session = MusicSession.find(create_music_session(user_id))
client_id = Faker::Number.number(20)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
client_id = Faker::Number.number(20)
@connman.create_connection(user_id, client_id, Faker::Internet.ip_v4_address)
@connman.create_connection(user_id, client_id, Faker::Internet.ip_v4_address, 'client')
music_session = MusicSession.find(create_music_session(user_id))
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
@ -510,11 +510,11 @@ describe ConnectionManager do
user.update_attribute(:admin, true)
client_id = Faker::Number.number(20)
@connman.create_connection(user_id, client_id, "1.1.1.1")
@connman.create_connection(user_id, client_id, "1.1.1.1", 'client')
music_session = MusicSession.find(create_music_session(user_id))
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
client_id = Faker::Number.number(20)
@connman.create_connection(user_id, client_id, Faker::Internet.ip_v4_address)
@connman.create_connection(user_id, client_id, Faker::Internet.ip_v4_address, 'client')
music_session = MusicSession.find(create_music_session(user_id))
connection = @connman.join_music_session(user, client_id, music_session, true, TRACKS)
connection.errors.size.should == 0

View File

@ -110,10 +110,12 @@
// create a login message using token (a cookie or similiar)
// reconnect_music_session_id is an optional argument that allows the session to be immediately associated
// with a music session.
factory.login_with_token = function(token, reconnect_music_session_id) {
factory.login_with_token = function(token, reconnect_music_session_id, client_type) {
//context.JK.logger.debug("*** login_with_token: client_id = "+$.cookie("client_id"));
var login = { token : token,
client_id : $.cookie("client_id")
var login = {
token : token,
client_id : $.cookie("client_id"),
client_type : client_type
};
return client_container(msg.LOGIN, route_to.SERVER, login);
};

View File

@ -89,7 +89,8 @@
server.rememberLogin = function() {
var token, loginMessage;
token = $.cookie("remember_token");
loginMessage = msg_factory.login_with_token(token, null);
var clientType = context.jamClient.IsNativeClient() ? 'client' : 'browser';
loginMessage = msg_factory.login_with_token(token, null, clientType);
server.send(loginMessage);
};

View File

@ -607,7 +607,7 @@
function CloseRecording() {}
function OnDownloadAvailable() {}
function SaveToClipboard(text) {}
function IsNativeClient() { return false; }
function IsNativeClient() { /* must always return false in all scenarios due to not ruin scoring !*/ return false; }
function SessionLiveBroadcastStart(host, port, mount, sourceUser, sourcePass, preferredClientId, bitrate)
{

View File

@ -11,6 +11,7 @@
};
var logger = context.JK.logger;
var rest = context.JK.Rest();
var sessionLatency;
var sessions = {};
var invitationSessionGroup = {};
@ -42,13 +43,19 @@
// squelch nulls and undefines
queryString = !!queryString ? queryString : "";
$.ajax({
type: "GET",
url: "/api/sessions?" + queryString,
success: afterLoadSessions,
complete: removeSpinner,
error: app.ajaxError
});
if(gon.use_cached_session_scores) {
rest.findScoredSessions(app.clientId, queryString)
.done(afterLoadScoredSessions)
.always(removeSpinner)
.fail(app.ajaxError)
}
else {
rest.findSessions(queryString)
.done(afterLoadSessions)
.fail(app.ajaxError)
.always(removeSpinner)
}
}
function search() {
@ -122,7 +129,31 @@
}
}
function afterLoadSessions(sessionList) {
function afterLoadScoredSessions(sessionList) {
// display the 'no sessions' banner if appropriate
var $noSessionsFound = $('#sessions-none-found');
if(sessionList.length == 0) {
$noSessionsFound.show();
}
else {
$noSessionsFound.hide();
}
$.each(sessionList, function(i, session) {
sessions[session.id] = session;
session.latencyInfo
});
$.each(sessionList, function(i, session) {
renderSession(session.id);
})
context.JK.GA.trackFindSessions(sessionList.length);
}
function afterLoadSessions(sessionList) {
// display the 'no sessions' banner if appropriate
var $noSessionsFound = $('#sessions-none-found');

View File

@ -1066,7 +1066,7 @@
// Clear out the 'timeout' variable.
context.JK.FtueWizard.latencyTimeout = false;
var now = new Date();
context.console.debug("ftueLatencyCallback: " + now);
console.log("ftueLatencyCallback: " + now);
context.JK.FtueWizard.latencyMS = latencyMS;
// Unregister callback:

View File

@ -34,6 +34,20 @@
});
}
function findSessions(queryString) {
return $.ajax({
type: "GET",
url: "/api/sessions?" + queryString
});
}
function findScoredSessions(clientId, queryString) {
return $.ajax({
type: "GET",
url: "/api/sessions/nindex/" + clientId + "?" + queryString
});
}
function updateSession(id, newSession) {
return $.ajax('/api/sessions/' + id, {
type: "PUT",
@ -897,6 +911,8 @@
this.getFollowers = getFollowers;
this.getBands = getBands;
this.getBandFollowers = getBandFollowers;
this.findSessions = findSessions;
this.findScoredSessions = findScoredSessions;
this.updateSession = updateSession;
this.getSessionHistory = getSessionHistory;
this.addSessionComment = addSessionComment;

View File

@ -711,7 +711,7 @@
if (notifyQueue.length === 0) {
firstNotification = true;
setNotificationInfo(message, descriptor);
setNotificationInfo(message, descriptor, $notify);
}
notifyQueue.push({message: message, descriptor: descriptor});
@ -733,11 +733,13 @@
if (notifyDetails !== undefined) {
setNotificationInfo(notifyDetails.message, notifyDetails.descriptor);
}
notifyDetails = {};
}
});
};
function setNotificationInfo(message, descriptor) {
function setNotificationInfo(message, descriptor, notificationSelector) {
var $notify = $('[layout="notify"]');
$('h2', $notify).text(message.title);
$('p', $notify).empty();
@ -763,19 +765,20 @@
$('div.detail', $notify).hide();
}
$('#ok-button', $notify).unbind('click');
$('#cancel-button', $notify).unbind('click');
if (descriptor) {
if (descriptor.ok_text) {
$('#ok-button', $notify).html(descriptor.ok_text);
}
else {
$('#ok-button', $notify).html("OKAY");
}
if (descriptor.ok_callback !== undefined) {
$('#ok-button', $notify).unbind('click');
$('#ok-button', $notify).click(function () {
}
$('#ok-button', $notify).click(function () {
if (descriptor.ok_callback !== undefined) {
if (descriptor.ok_callback_args) {
logger.debug("descriptor.ok_callback_args=" + descriptor.ok_callback_args);
descriptor.ok_callback(descriptor.ok_callback_args);
return false;
}
@ -783,8 +786,11 @@
descriptor.ok_callback();
return false;
}
});
}
}
else {
notificationSelector.hide();
}
});
if (descriptor.cancel_text) {
$('#cancel-button', $notify).html(descriptor.cancel_text);
@ -797,12 +803,10 @@
$('#cancel-button', $notify).html("CANCEL");
}
}
if (descriptor.cancel_callback !== undefined) {
$('#cancel-button', $notify).unbind('click');
$('#cancel-button', $notify).click(function () {
$('#cancel-button', $notify).click(function () {
if (descriptor.cancel_callback !== undefined) {
if (descriptor.cancel_callback_args) {
logger.debug("descriptor.cancel_callback_args=" + descriptor.cancel_callback_args);
descriptor.cancel_callback(descriptor.cancel_callback_args);
return false;
}
@ -810,12 +814,23 @@
descriptor.cancel_callback();
return false;
}
});
}
}
else {
notificationSelector.hide();
}
});
}
// by default OKAY and CANCEL should just hide the notification
else {
$('#ok-button', $notify).html("OKAY");
$('#ok-button', $notify).click(function () {
notificationSelector.hide();
});
$('#cancel-button', $notify).html("CANCEL");
$('#cancel-button', $notify).click(function () {
notificationSelector.hide();
});
}
}

View File

@ -481,6 +481,7 @@
var template = $('#template-profile-social').html();
var friendHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: "user-id",
hoverAction: val.musician ? "musician" : "fan",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
@ -501,7 +502,8 @@
var template = $('#template-profile-social').html();
var followingHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAction: val.musician ? "musician" : "fan",
hoverAttributeId: val.type === "user" ? "user-id" : "band-id",
hoverAction: val.type === "user" ? (val.musician ? "musician" : "fan") : "band",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
location: val.location
@ -519,6 +521,7 @@
var template = $('#template-profile-social').html();
var followerHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: "user-id",
hoverAction: val.musician ? "musician" : "fan",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,

View File

@ -129,11 +129,12 @@
}
}
else {
var $searchResults = $('div[layout-id=searchResults] div[user-id=' + val.id + ']');
if (val.is_friend || val.pending_friend_request || val.id === context.JK.currentUserId) {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').hide();
$searchResults.find('.btn-connect-friend').hide();
}
else {
$('div[user-id=' + val.id + ']').find('.btn-connect-friend').click(sendFriendRequest);
$searchResults.find('.btn-connect-friend').click(sendFriendRequest);
}
}
resultDivVisibility(val, isSidebar);

View File

@ -34,6 +34,11 @@
var gearLatency = context.jamClient.SessionGetDeviceLatency();
var showJoinLink = true;
// quick dance to make the new scoring find sessions API work
if(session.max_score) {
latencyInfo = {averageLatency: session.max_score}
}
var totalLatency = (latencyInfo.averageLatency / 2) + gearLatency;
logger.debug("latencyInfo.averageLatency=" + latencyInfo.averageLatency);

View File

@ -143,7 +143,7 @@
var template = $('#template-notification-panel').html();
var notificationHtml = context.JK.fillTemplate(template, {
notificationId: val.notification_id,
sessionId: val.sessionId,
sessionId: val.session_id,
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
text: val.formatted_msg,
date: $.timeago(val.created_at)
@ -515,8 +515,8 @@
function acceptFriendRequest(args) {
rest.acceptFriendRequest({
status : 'accept',
friend_request_id : args.friend_request_id
status: 'accept',
friend_request_id: args.friend_request_id
}).done(function(response) {
deleteNotification(args.notification_id); // delete notification corresponding to this friend request
initializeFriendsPanel(); // refresh friends panel when request is accepted

View File

@ -30,8 +30,9 @@
}
.musician-wrapper {
-ms-overflow-style: none;
overflow: initial;
height: initial;
height: 100%;
width: 100%;
}

View File

@ -1,5 +1,5 @@
class ApiIcecastController < ApiController
before_filter :local_only
#before_filter :local_only
before_filter :parse_mount
# each request will have this in it, if it's icecast.

View File

@ -25,6 +25,8 @@ class ClientsController < ApplicationController
# let javascript have access to the server's opinion if this is a native client
gon.isNativeClient = @nativeClient
gon.use_cached_session_scores = Rails.application.config.use_cached_session_scores
if current_user
render :layout => 'client'
else

View File

@ -4,4 +4,23 @@ attributes :description, :source_user_id, :target_user_id, :session_id, :recordi
node :notification_id do |n|
n.id
end
end
# this has to be flat like this so this payload is the same as the protocol buffer (see initializeActions in sidebar.js)
node :fan_access do |n|
unless n.session_id.blank?
n.session.fan_access
end
end
node :musician_access do |n|
unless n.session_id.blank?
n.session.musician_access
end
end
node :approval_required do |n|
unless n.session_id.blank?
n.session.approval_required
end
end

View File

@ -204,10 +204,10 @@
<script type="text/template" id="template-profile-social">
<div class="profile-block">
<div user-id="{userId}" hoveraction="{hoverAction}" class="avatar-small">
<div {hoverAttributeId}="{userId}" hoveraction="{hoverAction}" class="avatar-small">
<img src="{avatar_url}" />
</div>
<div user-id="{userId}" hoveraction="{hoverAction}" class="profile-block-name">{userName}</div>
<div {hoverAttributeId}="{userId}" hoveraction="{hoverAction}" class="profile-block-name">{userName}</div>
<div class="profile-block-city">{location}</div>
</div>
</script>

View File

@ -201,7 +201,7 @@
<li session-id="{sessionId}" notification-id="{notificationId}">
<div class="avatar-small"><img src="{avatar_url}" /></div>
<div class="note-text">
{text}&nbsp;&nbsp;
{text}<br/>
<em>{date}</em>
<div class="note-delete">
<a>

View File

@ -70,7 +70,7 @@
// but in any other mode, just trust the config coming through gon
JK.websocket_gateway_uri = gon.websocket_gateway_uri
<% end %>
if (console) { console.debug("websocket_gateway_uri:" + JK.websocket_gateway_uri); }
if (console) { console.log("websocket_gateway_uri:" + JK.websocket_gateway_uri); }
// If no trackVolumeObject (when not running in native client)
@ -207,11 +207,6 @@
var ftueWizard = new JK.FtueWizard(JK.app);
ftueWizard.initialize();
/* Commenting Out while reworking
var ftueAudioTestingScreen = new JK.FtueAudioTestingScreen(JK.app);
ftueAudioTestingScreen.initialize();
*/
var testBridgeScreen = new JK.TestBridgeScreen(JK.app);
testBridgeScreen.initialize();
@ -242,7 +237,7 @@
var start = new Date();
var returnVal = original.apply(originalJamClient, arguments)
var time = new Date().getTime() - start.getTime();
if(time > 0) {
if(time > 0) { // if 0, you'll see ALL bridge calls. If you set it to a higher value, you'll only see calls that are beyond that threshold
console.error(time + "ms jamClient." + jsKey);
}

View File

@ -26,7 +26,7 @@
};
function faderChange(faderId, newValue, dragging) {
console.debug('faderChange fired. ID: ' + faderId +
console.log('faderChange fired. ID: ' + faderId +
', val: ' + newValue + ', dragging: ' + dragging);
}

View File

@ -214,5 +214,8 @@ if defined?(Bundler)
config.send_join_session_email_notifications = true
config.use_promos_on_homepage = false
# should we use the new FindSessions API that has server-side scores
config.use_cached_session_scores = false
end
end

View File

@ -67,5 +67,7 @@ SampleApp::Application.configure do
config.twitter_app_secret = 'PfG1jAUMnyrimPcDooUVQaJrG1IuDjUyGg5KciOo'
config.use_promos_on_homepage = false
config.use_cached_session_scores = false
end

View File

@ -80,6 +80,7 @@ FactoryGirl.define do
countrycode 'US'
region 'TX'
city 'Austin'
client_type 'client'
end
factory :friendship, :class => JamRuby::Friendship do

View File

@ -448,8 +448,9 @@ module JamWebsockets
token = login.token if login.value_for_tag(3)
client_id = login.client_id if login.value_for_tag(4)
reconnect_music_session_id = login.reconnect_music_session_id if login.value_for_tag(5)
client_type = login.client_type if login.value_for_tag(6)
@log.info("*** handle_login: token=#{token}; client_id=#{client_id}")
@log.info("*** handle_login: token=#{token}; client_id=#{client_id}, client_type=#{client_type}")
reconnected = false
# you don't have to supply client_id in login--if you don't, we'll generate one
@ -529,7 +530,7 @@ module JamWebsockets
unless connection
# log this connection in the database
ConnectionManager.active_record_transaction do |connection_manager|
connection_manager.create_connection(user.id, client.client_id, remote_ip) do |conn, count|
connection_manager.create_connection(user.id, client.client_id, remote_ip, client_type) do |conn, count|
if count == 1
Notification.send_friend_update(user.id, true, conn)
end