We have a requirement to implement a feature in which we are only returning replies from a specific user AND all children of that reply unless the user is an administrator (in which case, show all replies so that admins can reply to users).
I've tried numerous things here (see links below), but there seems to be an issue in which replies aren't returned if they are not on the first page. Bumping the RootePageSize up fixes this, but we're still limited there to 100 and, in our communities, this number gets exceeded rather quickly.
So, I need a solution in which we return replies of the specific user regardless of which page it exists and also return all children of that reply.
I've tried numerous things. For starters, I just looped through the initial response from ThreadedList and picked added the replies to a separate list if author.id == user.id. This works until the RootPageSize is reached on the ThreadedList call.
I've also tried using the Search function - which may would work, except that there is no current way (that I can tell) to find all users in a role.. so I can't add moderator IDs to the query which means their replies do not get returned (see https://community.telligent.com/community/10/f/ask-the-community/1145619/getting-forum-replies-by-user)
Next, I thought possibly a binary search would suffice. Sort by UserID (as sorting is an option) and perform the binary search.. but again, I can't account for administrator role users here either.
Lastly I've tried just straight recursion - calling the custom made vm multiple times and updating the starting reply ID to get the next subset... but I can't seem to grab the last id of the last subset since I can't seem to find a way to test if the there should be more items (I've tried updating a variable each loop through and then checking to see if that variable == RootPageSize).
At this point I'm stuck. Any direction/help would be amazing.