core: improve core/backend search API
commit06f3b6d95852ec03a7555910d10815d858bb752a
authorStefan Becker <chemobejk@gmail.com>
Sun, 9 Sep 2012 14:39:07 +0000 (9 17:39 +0300)
committerStefan Becker <chemobejk@gmail.com>
Sun, 9 Sep 2012 15:14:03 +0000 (9 18:14 +0300)
tree27d8eea7861553d1d289331ddd73958914273059
parent7c0249b287d1e9425ae2b3062f1641af6370c0be
core: improve core/backend search API

Telepathy can start multiple searches and needs to be able to identify
which search results belong to which search channel.

Introduce an opaque token that the backend can supply when it requests a
search from the core. This token will be presented by the core when it
either tells the backend that search results are available or the search
has failed. Purple and Miranda backends ignore this token and simply
supply NULL.

Refactored search failure paths to call a new backend function with the
token and the message. For purple and Miranda backends this function is
simply implemented by calling sipe_backend_notify_error() like before.

Added search failure path for empty/invalid query.

Refactored SOAP code in sipe-buddy.c to use a common function. This new
function search_soap_request() implements the transaction payload that
carries the token to the callback.

Updated transactions_remove() to support transaction payloads without
destroy notifier.
src/api/sipe-backend.h
src/api/sipe-core.h
src/core/sip-transport.c
src/core/sipe-buddy.c
src/miranda/miranda-search.c
src/purple/purple-plugin.c
src/purple/purple-search.c
src/telepathy/telepathy-search.c