[lib] Move sorting logic to shared place
Summary: We need to sort the messages including sidebar source message. To do that we can use recently introduced sorting function, but need to move it to a common place. In message-utils there was already a sorting function which ignored ids during comparison. We can merge these and use common sorting logic in more places.
Test Plan:
Unfortunately, the old function was used only in notifications related places. I tested only message reducer parts and assumed that if the function works correctly there, it would also for notifications.
So I logged out, logged in and checked if the ordering was correct. Also, changed the ordering and verified that the result is visible.
Reviewers: ashoat
Reviewed By: ashoat
Subscribers: KatPo, zrebcu411, Adrian, atul, subnub
Differential Revision: https://phabricator.ashoat.com/D875