Display a user profile feed that contains only feed elements that are scoped to a specific community. Feed elements that have a User or a Group parent record are scoped to communities. Feed elements whose parents are record types other than User or Group are always visible in all communities. Other parent record types could be scoped to communities in the future.
ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.UserProfile, 'me', 3, ConnectApi.FeedDensity.FewerUpdates, null, null, ConnectApi.FeedSortOrder.LastModifiedDateDesc, ConnectApi.FeedFilter.CommunityScoped);