package controllers;


import models.*;
import play.mvc.*;

public class ViewProfile extends Controller {
	
	public static void page(String userName) {
		
		String myUsername = session.get("username");
		
		System.out.println("From MyProfile submit#current username: "+myUsername);
		// System.out.println("follo:" + folloUserid);
		
		boolean followed = false;
		if (myUsername == userName) {
			MyProfile.page();
		}
		
		if (userName != null) {
			User user = User.find("byEmail", userName).first();
			User me = User.find("byEmail", myUsername).first();

			if (user != null) {
				if (me.followed.contains(user)) {
					followed = true;
					System.out.println(user.fullname + " has been followed ");

				}
				render(user, followed);
			}
		}
		// MainPage.index();
		MyProfile.page();
	}	

}

@@ -130,23 +130,15 @@
 age(
-String userName
+Long Id
 ) %7B%0A
@@ -187,16 +187,58 @@
 name%22);%0A
+%09%09String userId = session.get(%22userId%22);%0A%0A
 %09%09%0A%09%09Sys
@@ -399,30 +399,36 @@
 if (
-myUsername == userName
+Long.parseLong(userId) == Id
 ) %7B%0A
@@ -461,24 +461,18 @@
 %09%0A%09%09if (
-userName
+Id
  != null
@@ -515,16 +515,10 @@
 l%22, 
-userName
+Id
 ).fi
@@ -558,26 +558,22 @@
 Email%22, 
-myUsername
+userId
 ).first(

change Viewprofile via name to via userId