Fixing bug to allow URLs to be passed around, evne if the user doesn't follow the blurblog.

This commit is contained in:
Samuel Clay 2012-04-30 12:20:04 -07:00
parent 18ffdb3920
commit 25fce20e07
3 changed files with 17 additions and 2 deletions

View file

@ -1028,7 +1028,7 @@ class MSharedStory(mongo.Document):
story['shared_by_friends'] = friends_with_shares
story['share_count_public'] = story['share_count'] - len(friends_with_shares)
story['share_count_friends'] = len(friends_with_shares)
if story['source_user_id']:
if story.get('source_user_id'):
profile_user_ids.add(story['source_user_id'])
profiles = MSocialProfile.objects.filter(user_id__in=list(profile_user_ids))

View file

@ -39,7 +39,16 @@ NEWSBLUR.Router = Backbone.Router.extend({
social: function(user_id, slug) {
console.log(["router:social", user_id, slug]);
var feed_id = "social:" + user_id;
NEWSBLUR.reader.open_social_stories(feed_id, {force: true});
if (NEWSBLUR.reader.model.get_feed(feed_id)) {
NEWSBLUR.reader.open_social_stories(feed_id, {force: true});
} else {
NEWSBLUR.reader.load_social_feed_in_tryfeed_view(feed_id, {force: true, feed: {
username: _.string.humanize(slug),
id: feed_id,
user_id: parseInt(user_id, 10),
feed_title: _.string.humanize(slug)
}});
}
},
user: function(user) {

View file

@ -7011,6 +7011,12 @@
options = options || {};
if (_.isNumber(social_feed)) {
social_feed = this.model.get_feed('social:' + social_feed);
} else if (_.isString(social_feed)) {
social_feed = this.model.get_feed(social_feed);
}
if (!social_feed) {
social_feed = this.model.add_social_feed(options.feed);
}
var $tryfeed_container = this.$s.$tryfeed_header.closest('.NB-feeds-header-container');