@Override public Long getValue(final Pair<String, String> current_friend) { return DB.getHumanCrudWallLocal(false) .readWallId( new HumanId(current_friend.getValue()), new Obj<String>(current_friend.getKey())) .returnValueBadly(); }
@Override public Msg getValue(final String whosWall, final String visitor) { final List<Msg> msgs = DB.getHumanCrudWallLocal(false) .readWallLastEntries( new HumanId(whosWall), new Obj<String>(visitor), 1, new RefreshSpec()) .returnValue(); return msgs.size() != 0 ? msgs.get(0) : null; // Well the comment that was here before was false!!! We all make // mistakes! }
@Override protected void init(final Object... initArgs) { this.requestedProfile = ((HumanId) initArgs[0]).getSelfAsValid(); this.currUserAsVisitor = ((HumanId) initArgs[1]).getSelfAsValid(); final HumansIdentity currUserAsVisitorHI = UserProperty.HUMANS_IDENTITY_CACHE.get((currUserAsVisitor.getHumanId()), ""); final HumansIdentity requestedProfileHI = UserProperty.HUMANS_IDENTITY_CACHE.get((requestedProfile.getHumanId()), ""); super.setWallProfileName(currUserAsVisitorHI.getHuman().getDisplayName()); super.setWallProfilePhoto( UserProperty.formatProfilePhotoUrl(currUserAsVisitorHI.getHumansIdentityProfilePhoto())); super.setWallTitle( MessageFormat.format( RBGet.gui().getString(TALK_AT_DOWN_TOWN_ER_0_S), requestedProfileHI.getHuman().getDisplayName())); final int friendCount = ((List<HumansNetPeople>) $$getHumanUserFromRequest(request) .cache(requestedProfile.getHumanId(), DownTownFlow.FRIENDS)) .size(); UCAddFriends: if (requestedProfile.equals(currUserAsVisitor)) { // Accessing own profile UCInviteFriendsIfNoFriends: { if (friendCount < 2) { $$displayNone(WallWidgetIds.wallWidget); String title = "Without followers your updates will be useless"; // https://upload.wikimedia.org/wikipedia/commons/8/8d/Ambox_padlock_red.svg new Info( request, new InfoCriteria().setImage("/images/What_is_exciting_lately.png"), $$(WallWidgetIds.wallGame)); new Info( request, new InfoCriteria().setImage("/images/What_is_exciting_lately_Talk.png"), $$(WallWidgetIds.wallGame)); new Info(request, new InfoCriteria(), $$(WallWidgetIds.wallGame)) { /** * Use this only in conjunction with GENERIC constructor. * * @param infoCriteria */ @Override protected void init(InfoCriteria infoCriteria) { UCSetFriendAddWidget: { String addFollowerTitle = ""; if (friendCount == 0) { addFollowerTitle = "Add 2 Follower emails To Start Posting!"; } else if (friendCount == 1) { addFollowerTitle = "Almost there! Add 1 More Follower To Posting!"; } new AdaptableSignup( request, new AdaptableSignupCriteria() .setHumanId(requestedProfile) .setWidgetTitle(addFollowerTitle) .setAdaptableSignupCallback( new AdaptableSignupCallback() { @Override public String afterInvite(final HumanId invitee) { return ai.ilikeplaces.logic.Listeners.widgets .UserProperty .HUMANS_IDENTITY_CACHE .get(invitee.getHumanId(), invitee.getHumanId()) .getHuman() .getDisplayName() + " is now following you!"; } @Override public String jsToSend(HumanId invitee) { return JSCodeToSend.refreshPageIn(5); } }), $$(InfoIds.InfoAppend)); } } }; } else { String addFollowerTitle = "Add more followers!"; new AdaptableSignup( request, new AdaptableSignupCriteria() .setHumanId(requestedProfile) .setWidgetTitle(addFollowerTitle) .setAdaptableSignupCallback( new AdaptableSignupCallback() { @Override public String afterInvite(final HumanId invitee) { return ai.ilikeplaces.logic.Listeners.widgets .UserProperty .HUMANS_IDENTITY_CACHE .get(invitee.getHumanId(), invitee.getHumanId()) .getHuman() .getDisplayName() + " is now following you!"; } @Override public String jsToSend(HumanId invitee) { return JSCodeToSend.refreshPageIn(5); } }), $$(WallWidgetIds.wallFollowers)); } } } fetchToEmail(); final Wall wall = DB.getHumanCrudWallLocal(true) .readWall(requestedProfile, new Obj<HumanId>(currUserAsVisitor), REFRESH_SPEC) .returnValueBadly(); final List<Msg> wallEntries = DB.getHumanCrudWallLocal(true) .readWallLastEntries( requestedProfile, new Obj<HumanId>(currUserAsVisitor), 25, REFRESH_SPEC_EMPTY) .returnValueBadly(); for (final Msg msg : wallEntries) { new UserProperty(request, $$(WallWidgetIds.wallContent), new HumanId(msg.getMsgMetadata())) { protected void init(final Object... initArgs) { $$(Controller.Page.user_property_content).setTextContent(msg.getMsgContent()); } }; } DB.getHumanCRUDHumansUnseenLocal(false) .removeEntry(currUserAsVisitor.getObjectAsValid(), wall.getWallId()); $$displayWallAsMuted( $$(WallWidgetIds.wallMute), wall.getWallMutes().contains(currUserAsVisitor)); UCFiltering: { final List<HumansNetPeople> beFriends = (List<HumansNetPeople>) $$getHumanUserFromRequest(request) .cache(requestedProfile.getHumanId(), DownTownFlow.FRIENDS); @_see( seeClasses = { WallWidgetHumansWall.class, PrivateEventDelete.class, PrivateEventView.class, Tribe.class }) final String peopleFetchToEmail1 = new People( request, new PeopleCriteria().setPeople((List<HumanIdFace>) (List<?>) beFriends), $(Controller.Page.Skeleton_left_column)) .fetchToEmail; Loggers.debug("PEOPLE FETCH TO EMAIL CONTENT:" + peopleFetchToEmail1); fetchToEmailSetLeftSidebar(peopleFetchToEmail1); fetchToEmailSetRightSidebar(" "); } }