My initial port of this wasn't great, this is much better.
Testing Done:
sent messages between pidgin2 with gkdr/carbons, conversations on my phone, and pidgin3. I sent messages from all clients and received them on all three clients.
Reviewed at https://reviews.imfreedom.org/r/462/
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.