[lib] refactor code to update reply count and unread status to function
Summary:
ENG-9273.
I need to reuse this function to bump reply count as part of useSendComposableDMOperation.
Did some additional cleanup to avoid selecting the same data multiple times.
Test Plan: Flow, functionality tested later in the stack
Reviewers: tomek, marcin
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13426