summaryrefslogtreecommitdiff
path: root/src/search-manager.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-08-25 14:04:09 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-08-25 14:04:09 +0100
commit1b277079ed620ddbe7eb0c5ee2f8569b0b442104 (patch)
tree1df9696314f0e519e8bb899309edfe990031da1f /src/search-manager.c
parentc7b7d401501014d6236793da2ed05c5621762afb (diff)
search_channel_ready_or_not_cb: raise PermissionDenied if XMPP error is Forbidden and InvalidArgument if it's jid-malformed
Diffstat (limited to 'src/search-manager.c')
-rw-r--r--src/search-manager.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/search-manager.c b/src/search-manager.c
index 6b657f6fa..9872f49f9 100644
--- a/src/search-manager.c
+++ b/src/search-manager.c
@@ -414,11 +414,18 @@ search_channel_ready_or_not_cb (GabbleSearchChannel *chan,
if (domain == GABBLE_XMPP_ERROR)
{
domain = TP_ERRORS;
- /* - Maybe CreateChannel should be specced to raise PermissionDenied?
- * Then we could map XMPP_ERROR_FORBIDDEN to that.
- * - Should XMPP_ERROR_JID_MALFORMED be mapped to InvalidArgument?
- */
- code = TP_ERROR_NOT_AVAILABLE;
+
+ switch (code)
+ {
+ case XMPP_ERROR_FORBIDDEN:
+ code = TP_ERROR_PERMISSION_DENIED;
+ break;
+ case XMPP_ERROR_JID_MALFORMED:
+ code = TP_ERROR_INVALID_ARGUMENT;
+ break;
+ default:
+ code = TP_ERROR_NOT_AVAILABLE;
+ }
}
else
{