From 706cb308cc30fa49bcb7ad65294282a8c35e85a5 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 13 Dec 2014 22:23:16 +0200 Subject: [PATCH] svc: re-factor sipe_svc_ab_entry_request() Move "ChangeSearch" XML node generation to caller. This prepares the interface for other AbEntryRequest query types. --- src/core/sipe-buddy.c | 13 ++++++++++--- src/core/sipe-svc.c | 6 +----- src/core/sipe-svc.h | 6 ++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/sipe-buddy.c b/src/core/sipe-buddy.c index 7f5ae012..d825e690 100644 --- a/src/core/sipe-buddy.c +++ b/src/core/sipe-buddy.c @@ -991,16 +991,23 @@ static void ms_dlx_webticket(struct sipe_core_private *sipe_private, if (wsse_security) { gchar *query = prepare_buddy_search_query(mdd->search_rows, TRUE); + gchar *search; SIPE_DEBUG_INFO("ms_dlx_webticket: got ticket for %s", base_uri); + search = g_strdup_printf("" + " %s" + "", + g_slist_length(mdd->search_rows) / 2, + query); + g_free(query); + if (sipe_svc_ab_entry_request(sipe_private, mdd->session, auth_uri, wsse_security, - query, - g_slist_length(mdd->search_rows) / 2, + search, mdd->max_returns, mdd->callback, mdd)) { @@ -1011,7 +1018,7 @@ static void ms_dlx_webticket(struct sipe_core_private *sipe_private, /* callback data passed down the line */ mdd = NULL; } - g_free(query); + g_free(search); } else { /* no ticket: this will show the minmum information */ diff --git a/src/core/sipe-svc.c b/src/core/sipe-svc.c index 92f4ec99..b3a65ef8 100644 --- a/src/core/sipe-svc.c +++ b/src/core/sipe-svc.c @@ -392,7 +392,6 @@ gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private, const gchar *uri, const gchar *wsse_security, const gchar *search, - guint entries, guint max_returns, sipe_svc_callback *callback, gpointer callback_data) @@ -404,9 +403,7 @@ gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private, " xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"" ">" " " - " " - " %s" - " " + " %s" " " " false" " %d" @@ -414,7 +411,6 @@ gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private, " " " " "", - entries, search, max_returns); diff --git a/src/core/sipe-svc.h b/src/core/sipe-svc.h index 6a093377..b9c22505 100644 --- a/src/core/sipe-svc.h +++ b/src/core/sipe-svc.h @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2011-12 SIPE Project + * Copyright (C) 2011-2014 SIPE Project * * * This program is free software; you can redistribute it and/or modify @@ -89,8 +89,7 @@ gboolean sipe_svc_get_and_publish_cert(struct sipe_core_private *sipe_private, * @param session opaque session pointer * @param uri service URI * @param wsse_security predefined authentication token - * @param search [MS-DLX] AbEntryRequest.ChangeSearchQuery in XML - * @param entries array entries in search XML string + * @param search [MS-DLX] AbEntryRequest.ChangeSearchQuery/BasicSearch in XML * @param max_returns how many entries to return * @param callback callback function * @param callback_data callback data @@ -101,7 +100,6 @@ gboolean sipe_svc_ab_entry_request(struct sipe_core_private *sipe_private, const gchar *uri, const gchar *wsse_security, const gchar *search, - guint entries, guint max_returns, sipe_svc_callback *callback, gpointer callback_data); -- 2.11.4.GIT