Support hydrating embedded threads in incoming webhooks #289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pulls the code from #208
It keeps just the hydrating embedded threads part of that pull request while removing the part that added withEmbed to conversation filters.
I'm pulling this back up because when getting webhooks with the
IncomingWebhook
class the threads are all embedded in the request, but it is impossible to access them since they are never hydrated.The only thing that might be missing here is getting the correct value for
->getThreadCount()
.Currently the webhooks I'm getting are setting
threads
to1
which in this code:Sets it to that. I'm not sure if embedded threads should do anything to change that without knowing how the underlying system works so I'll leave that up to you if that needs to be modified more. This change doesn't change that at all from how it currently works anyway. And this change allows me to use
->getThreads()
which is the goal of what I'm trying to do with this.