[Telepathy-commits] [telepathy-qt4/master] Channel: don't second-guess the CM

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Mar 5 09:03:00 PST 2009


Similarly to ContactManager, if the group flags indicate we're likely to
fail, we should still make the attempt, so the connection manager can give
us the most appropriate error.
---
 TelepathyQt4/Client/channel.cpp |   32 --------------------------------
 1 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/TelepathyQt4/Client/channel.cpp b/TelepathyQt4/Client/channel.cpp
index f65aba3..0a8ee5a 100644
--- a/TelepathyQt4/Client/channel.cpp
+++ b/TelepathyQt4/Client/channel.cpp
@@ -1261,15 +1261,6 @@ PendingOperation *Channel::groupAddContacts(const QList<QSharedPointer<Contact>
         warning() << "Channel::groupAddContacts() used channel not ready";
         return new PendingFailure(this, TELEPATHY_ERROR_NOT_AVAILABLE,
                 "Channel not ready");
-    } else if (!groupCanAddContacts()) {
-        foreach (const QSharedPointer<Contact> &contact, contacts) {
-            if (!mPriv->groupLocalPendingContacts.contains(contact->handle()[0])) {
-                warning() << "Channel::groupAddContacts() used but adding contacts "
-                    "that are not in local pending list is not supported";
-                return new PendingFailure(this, TELEPATHY_ERROR_NOT_IMPLEMENTED,
-                        "Channel does not support adding contacts not in local pending list");
-            }
-        }
     } else if (contacts.isEmpty()) {
         warning() << "Channel::groupAddContacts() used with empty contacts param";
         return new PendingFailure(this, TELEPATHY_ERROR_INVALID_ARGUMENT,
@@ -1367,29 +1358,6 @@ PendingOperation *Channel::groupRemoveContacts(const QList<QSharedPointer<Contac
         }
     }
 
-    if (!groupCanRemoveContacts()) {
-        foreach (const QSharedPointer<Contact> &contact, contacts) {
-            if (mPriv->groupContacts.contains(contact->handle()[0])) {
-                warning() << "Channel::groupRemoveContacts() used but remove a contact "
-                    "in groupContacts() but contacts in groupContacts() can't be removed "
-                    "on this channel";
-                return new PendingFailure(this, TELEPATHY_ERROR_NOT_IMPLEMENTED,
-                        "Channel does not support removing contacts in groupContacts()");
-            }
-        }
-    }
-
-    if (!groupCanRescindContacts()) {
-        foreach (const QSharedPointer<Contact> &contact, contacts) {
-            if (mPriv->groupRemotePendingContacts.contains(contact->handle()[0])) {
-                warning() << "Channel::groupRemoveContacts() used to rescind a contact "
-                    "but contacts can't be rescinded on this channel";
-                return new PendingFailure(this, TELEPATHY_ERROR_NOT_IMPLEMENTED,
-                        "Channel does not support rescinding contacts");
-            }
-        }
-    }
-
     if (!mPriv->interfaces.contains(TELEPATHY_INTERFACE_CHANNEL_INTERFACE_GROUP)) {
         warning() << "Channel::groupRemoveContacts() used with no group interface";
         return new PendingFailure(this, TELEPATHY_ERROR_NOT_IMPLEMENTED,
-- 
1.5.6.5




More information about the telepathy-commits mailing list