From 50f45c841828459b7486ac445a4dc456f00e87a9 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 8 Dec 2011 15:13:13 +0200 Subject: [PATCH] core cleanup: move out batched_support flag --- src/core/sip-transport.c | 4 ++-- src/core/sipe-core-private.h | 8 +++++--- src/core/sipe-notify.c | 4 ++-- src/core/sipe.h | 1 - 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/sip-transport.c b/src/core/sip-transport.c index c92bba3d..d9435648 100644 --- a/src/core/sip-transport.c +++ b/src/core/sip-transport.c @@ -1049,7 +1049,7 @@ static gboolean process_register_response(struct sipe_core_private *sipe_private } SIPE_CORE_PRIVATE_FLAG_UNSET(OCS2007); SIPE_CORE_PRIVATE_FLAG_UNSET(REMOTE_USER); - sip->batched_support = FALSE; + SIPE_CORE_PRIVATE_FLAG_UNSET(BATCHED_SUPPORT); while(hdr) { @@ -1061,7 +1061,7 @@ static gboolean process_register_response(struct sipe_core_private *sipe_private SIPE_DEBUG_INFO("Supported: %s (indicates OCS2007+)", elem->value); } if (sipe_strcase_equal(elem->value, "adhoclist")) { - sip->batched_support = TRUE; + SIPE_CORE_PRIVATE_FLAG_SET(BATCHED_SUPPORT); SIPE_DEBUG_INFO("Supported: %s", elem->value); } } diff --git a/src/core/sipe-core-private.h b/src/core/sipe-core-private.h index c11a42c8..e853d95e 100644 --- a/src/core/sipe-core-private.h +++ b/src/core/sipe-core-private.h @@ -99,12 +99,14 @@ struct sipe_core_private { * Flags - stored in sipe_core_public.flags but names not exported */ /* server is OCS2007+ */ -#define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000 +#define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000 /* we are connected from outside the enterprise network boundary * via Edge Server */ -#define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000 +#define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000 /* multiple points of presence detected */ -#define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000 +#define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000 +/* if there is support for batched subscription*/ +#define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \ ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag) diff --git a/src/core/sipe-notify.c b/src/core/sipe-notify.c index a8033433..c694a33a 100644 --- a/src/core/sipe-notify.c +++ b/src/core/sipe-notify.c @@ -1205,7 +1205,7 @@ static gboolean sipe_process_roaming_contacts(struct sipe_core_private *sipe_pri /* subscribe to buddies */ if (!sip->subscribed_buddies) { //do it once, then count Expire field to schedule resubscribe. - if (sip->batched_support) { + if (SIPE_CORE_PRIVATE_FLAG_IS(BATCHED_SUPPORT)) { sipe_subscribe_presence_batched(sipe_private); } else { g_hash_table_foreach(sipe_private->buddies, @@ -1520,7 +1520,7 @@ void process_incoming_notify(struct sipe_core_private *sipe_private, gchar *who = parse_from(sipmsg_find_header(msg, "To")); gchar *action_name = sipe_utils_presence_key(who); - if (sip->batched_support) { + if (SIPE_CORE_PRIVATE_FLAG_IS(BATCHED_SUPPORT)) { sipe_process_presence_timeout(sipe_private, msg, who, timeout); } else { diff --git a/src/core/sipe.h b/src/core/sipe.h index 947f8ff9..18e8ab3c 100644 --- a/src/core/sipe.h +++ b/src/core/sipe.h @@ -85,7 +85,6 @@ struct sipe_account_data { gchar *note; time_t note_since; time_t idle_switch; - gboolean batched_support; /*if there is support for batched subscription*/ GSList *containers; /* MS-PRES containers */ struct _PurpleAccount *account; gchar *regcallid; -- 2.11.4.GIT