myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [1935] branches/event_logging/app: News generatio


From: noreply
Subject: [myexperiment-hackers] [1935] branches/event_logging/app: News generation.
Date: Mon, 10 Nov 2008 08:18:07 -0500 (EST)

Revision
1935
Author
alekses6
Date
2008-11-10 08:18:05 -0500 (Mon, 10 Nov 2008)

Log Message

News generation.

1) Bug-fix for the previous commit. "authorized" variable was used without being initialized properly when interpreting "friendship" and "membership" event log entries into news entries.

2) Cache fragments for user / group profiles now have more sensible "viewer" - "public" instead of none.

Modified Paths

Diff

Modified: branches/event_logging/app/helpers/application_helper.rb (1934 => 1935)


--- branches/event_logging/app/helpers/application_helper.rb	2008-11-10 13:00:21 UTC (rev 1934)
+++ branches/event_logging/app/helpers/application_helper.rb	2008-11-10 13:18:05 UTC (rev 1935)
@@ -1798,6 +1798,7 @@
             authorized = true
           elsif ["invite", "request", "reject"].include? action
             # only group admin OR the user in this action allowed to view
+            authorized = true
             authorized = false if (contributor.nil? || current_viewer.nil? || current_viewer == 0)
             authorized = (current_viewer_id == user_id || current_viewer_id == network_admin.id) if authorized
           else
@@ -1850,6 +1851,7 @@
           authorized = true
         elsif ["create", "reject"].include? action
           # only the "user" OR the "friend" in this action allowed to view
+          authorized = true
           authorized = false if (contributor.nil? || current_viewer.nil? || current_viewer == 0)
           authorized = (my_event || current_viewer_id == referenced_user.id) if authorized
         else

Modified: branches/event_logging/app/views/networks/show.rhtml (1934 => 1935)


--- branches/event_logging/app/views/networks/show.rhtml	2008-11-10 13:00:21 UTC (rev 1934)
+++ branches/event_logging/app/views/networks/show.rhtml	2008-11-10 13:18:05 UTC (rev 1935)
@@ -150,7 +150,7 @@
   <div class="tabTitle">News</div>
   <div class="tabContent">  
     <% benchmark "Group page news feed" do %>
-      <% viewer_id = (logged_in? ? current_user.id : nil) -%>
+      <% viewer_id = (logged_in? ? current_user.id : "public") -%>
 			<% cache_timeout({ :controller => 'news', :action ="" 'network_profile', :id => @network.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
 			  <%= render :partial => "layouts/news", :locals => { :collection => news(@network, true, Time.now, Time.now-DEFAULT_GROUP_NEWS_TIMEFRAME, DEFAULT_GROUP_NEWS_COUNT, current_user) } %>
       <% end -%>

Modified: branches/event_logging/app/views/users/show.rhtml (1934 => 1935)


--- branches/event_logging/app/views/users/show.rhtml	2008-11-10 13:00:21 UTC (rev 1934)
+++ branches/event_logging/app/views/users/show.rhtml	2008-11-10 13:18:05 UTC (rev 1935)
@@ -354,7 +354,7 @@
 
   <% case @tab; when "News" %>
     <% benchmark "User profile page news feed" do %>
-      <% viewer_id = (logged_in? ? current_user.id : nil) -%>
+      <% viewer_id = (logged_in? ? current_user.id : "public") -%>
 			<% cache_timeout({ :controller => 'news', :action ="" 'user_profile', :id => @user.id, :viewer => viewer_id } , NEWS_CACHE_TIMEOUT.seconds.from_now ) do -%>
   			<%= render :partial => "layouts/news", :locals => { :collection => news(@user, true, Time.now, Time.now-DEFAULT_USER_NEWS_TIMEFRAME, DEFAULT_USER_NEWS_COUNT, current_user) } %>
 		  <% end %>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]