[telepathy-qt4/master] Channel: Use change-reason when invalidating channel on closed.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Fri Jul 24 10:58:23 PDT 2009
---
TelepathyQt4/channel.cpp | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/TelepathyQt4/channel.cpp b/TelepathyQt4/channel.cpp
index 36a72b2..66f6a7e 100644
--- a/TelepathyQt4/channel.cpp
+++ b/TelepathyQt4/channel.cpp
@@ -2161,8 +2161,21 @@ void Channel::gotInterfaces(QDBusPendingCallWatcher *watcher)
void Channel::onClosed()
{
debug() << "Got Channel::Closed";
- // I think this is the nearest error code we can get at the moment
- invalidate(TELEPATHY_ERROR_CANCELLED, "Closed");
+
+ QString error;
+ QString message;
+ if (mPriv->groupSelfContactRemoveInfo.isValid() &&
+ mPriv->groupSelfContactRemoveInfo.hasReason()) {
+ error = mPriv->groupMemberChangeDetailsTelepathyError(
+ mPriv->groupSelfContactRemoveInfo);
+ message = mPriv->groupSelfContactRemoveInfo.message();
+ } else {
+ // I think this is the nearest error code we can get at the moment
+ error = TELEPATHY_ERROR_CANCELLED;
+ message = "Closed";
+ }
+
+ invalidate(error, message);
}
void Channel::onConnectionReady(PendingOperation *op)
--
1.5.6.5
More information about the telepathy-commits
mailing list