It iterates all the possibilities of reply IDs and using the first we found in our freescout threads, following the order: In-Reply-To, References (by order), special FS marker. In most cases it will work as always (getting the In-Reply-To at the first attempt), but if not, it will try the other possibilites.
Fixes https://github.com/freescout-helpdesk/freescout/issues/4020
It iterates all the possibilities of reply IDs and using the first we found in our freescout threads, following the order: In-Reply-To, References (by order), special FS marker. In most cases it will work as always (getting the In-Reply-To at the first attempt), but if not, it will try the other possibilites.