public List<Message> getUserMessages(String user, int nbMessages, clientInterface cl){
		List<Message> res = new ArrayList<Message>();
		int numberOfMessages = nbMessages;
		User usr = retrieveUser(user);
		
		if(usr == null){
			System.out.println("Error, unknown user");
			return null;
		}
		
		for (User followed : usr.getFollowed()) {
			//Ajoute les messages des personnes suivie
			addAllTo(getMessagesFrom(followed.getName(), numberOfMessages), res);
			addAllTo(getMessagesTo(followed.getName(), numberOfMessages), res);
		}
		
		for(String interest : usr.getInterest()){
			//Ajoute les messages convernant les hashtags suivis
			addAllTo(getMessagesAbout(interest, numberOfMessages), res);
		}
		
		addAllTo(getMessagesFrom(user, numberOfMessages), res);
		
		addAllTo(getMessagesTo(usr.getName(), numberOfMessages), res);
		
		
		Collections.sort(res);
		Collections.reverse(res);
		
		if(res.size() > numberOfMessages){
			res.removeAll(res.subList(0,res.size() - numberOfMessages));
		} else {
			numberOfMessages = res.size();
		}

		try{
			int mesRead = cl.getNbMessageRead();
			
			if(mesRead + 5 >= numberOfMessages){
				System.out.println("pull finished");
				cl.pullFinished();
			}

			List<Message> res2 = new ArrayList<Message>();
			res2.addAll(res.subList( mesRead,  Math.min(mesRead + 5, res.size())));

			return res2;
			
		} catch (Exception e) {
			System.out.println("error dans get user message");
		}

		
		try {
			System.out.println("get User messages requested" + " nbLu : " + cl.getNbMessageRead()+ " nbMesReq : " + nbMessages);
		} catch (RemoteException e) {

		}
		
		return new ArrayList<Message>();
	}