r7216 - in dumbhippo/trunk/server/src/com/dumbhippo: server/impl web/servlets



Author: marinaz
Date: 2008-01-15 21:21:47 -0600 (Tue, 15 Jan 2008)
New Revision: 7216

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
   dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookSigninServlet.java
Log:
Show "Invite Friends" link in the profile box.

Give invitations to the Facebook users who enable their Mugshot account.

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java	2008-01-15 22:52:28 UTC (rev 7215)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java	2008-01-16 03:21:47 UTC (rev 7216)
@@ -687,6 +687,10 @@
 	private String createFbmlForUser(Account account, Set<ExternalAccountView> allAccounts) {
 		User user = account.getOwner();
 
+        String applicationName = "mugshot";
+        if (config.getBaseUrlMugshot().toExternalForm().contains("dogfood"))
+        	applicationName = "mugshot-test";
+        
 		StringBuilder fbmlSb = new StringBuilder("");
 		fbmlSb.append("<fb:subtitle>Displaying latest updates.");
 		
@@ -694,18 +698,19 @@
 		// <fb:action> tag doesn't work inside <fb:visible-to-owner>,
 		// so we need to use the following barbaric methods to right align the 'Edit Account' action 
 		fbmlSb.append("<fb:wide>");	
-		for (int i=1; i<=63; i++ ) {
+		for (int i=1; i<=33; i++ ) {
 		    fbmlSb.append("&nbsp;");
 		}
 		fbmlSb.append("</fb:wide>");	
-		
+        		
 		fbmlSb.append("<fb:narrow>");	
-		for (int i=1; i<=25; i++ ) {
+		for (int i=1; i<=2; i++ ) {
 		    fbmlSb.append("&nbsp;");
 		}
 		fbmlSb.append("</fb:narrow>");
 	
-		fbmlSb.append("<fb:fbml version='1.1'><fb:visible-to-owner><a href='http://apps.facebook.com/mugshot' style='float:right;'>Edit Accounts</a>" +
+		fbmlSb.append("<fb:fbml version='1.1'><fb:visible-to-owner><a href='http://apps.facebook.com/"; + applicationName +"?mugshot_tab=home' style='float:right;'>Edit Accounts</a>" +
+                      "| <a href='http://apps.facebook.com/"; + applicationName +"?mugshot_tab=invite' style='float:right;'>Invite Friends</a>" +
 		              "</fb:visible-to-owner></fb:fbml></fb:subtitle>");
 
 		// add the accounts ribbon

Modified: dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookSigninServlet.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookSigninServlet.java	2008-01-15 22:52:28 UTC (rev 7215)
+++ dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookSigninServlet.java	2008-01-16 03:21:47 UTC (rev 7216)
@@ -96,6 +96,9 @@
 			    			sess.invalidate();
 			    		SigninBean.initializeAuthentication(request, response, client);
 			    		ac.getOwner().getAccount().setPublicPage(true);
+			    		String regularCountString = config.getProperty(HippoProperty.NEW_USER_INVITATION_COUNT);
+			    		int regularCount = Integer.parseInt(regularCountString);
+			    		ac.getOwner().getAccount().setInvitations(regularCount);
 			    		// set a better name for a Facebook user, since now the user can edit it, and
 			    		// we won't be needing to get it from Facebook again
 			    		if (ac.getOwner().getNickname().contains("Facebook user")) {



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