From ef456a0cff23b686575a8cc81c43a27b2c555f21 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 8 Dec 2011 20:57:00 +0200 Subject: [PATCH] core cleanup: move out do_not_publish field --- src/core/sipe-core-private.h | 3 +++ src/core/sipe-status.c | 16 ++++++++-------- src/core/sipe.h | 1 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/core/sipe-core-private.h b/src/core/sipe-core-private.h index c687f69c..fff8d9d6 100644 --- a/src/core/sipe-core-private.h +++ b/src/core/sipe-core-private.h @@ -60,6 +60,9 @@ struct sipe_core_private { GSList *sessions; GSList *sessions_to_accept; + /* Presence */ + time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES]; + /* [MS-SIP] deltaNum counters */ guint deltanum_contacts; guint deltanum_acl; /* setACE (OCS2005 only) */ diff --git a/src/core/sipe-status.c b/src/core/sipe-status.c index 52da556f..f9dd3bcf 100644 --- a/src/core/sipe-status.c +++ b/src/core/sipe-status.c @@ -120,10 +120,10 @@ void sipe_status_and_note(struct sipe_core_private *sipe_private, /* status has changed */ guint activity = sipe_backend_token_to_activity(status_id); - sip->do_not_publish[activity] = time(NULL); + sipe_private->do_not_publish[activity] = time(NULL); SIPE_DEBUG_INFO("sipe_status_and_note: do_not_publish[%s]=%d [now]", status_id, - (int) sip->do_not_publish[activity]); + (int) sipe_private->do_not_publish[activity]); } } @@ -152,7 +152,7 @@ void sipe_core_status_set(struct sipe_core_public *sipe_public, gchar *tmp; time_t now = time(NULL); guint activity = sipe_backend_token_to_activity(status_id); - gboolean do_not_publish = ((now - sip->do_not_publish[activity]) <= 2); + gboolean do_not_publish = ((now - sipe_private->do_not_publish[activity]) <= 2); /* when other point of presence clears note, but we are keeping * state if OOF note. @@ -165,12 +165,12 @@ void sipe_core_status_set(struct sipe_core_public *sipe_public, do_not_publish = FALSE; } - SIPE_DEBUG_INFO("sipe_core_status_set: was: sip->do_not_publish[%s]=%d [?] now(time)=%d", - status_id, (int)sip->do_not_publish[activity], (int)now); + SIPE_DEBUG_INFO("sipe_core_status_set: was: sipe_private->do_not_publish[%s]=%d [?] now(time)=%d", + status_id, (int)sipe_private->do_not_publish[activity], (int)now); - sip->do_not_publish[activity] = 0; - SIPE_DEBUG_INFO("sipe_core_status_set: set: sip->do_not_publish[%s]=%d [0]", - status_id, (int)sip->do_not_publish[activity]); + sipe_private->do_not_publish[activity] = 0; + SIPE_DEBUG_INFO("sipe_core_status_set: set: sipe_private->do_not_publish[%s]=%d [0]", + status_id, (int)sipe_private->do_not_publish[activity]); if (do_not_publish) { SIPE_DEBUG_INFO_NOFORMAT("sipe_core_status_set: publication was switched off, exiting."); diff --git a/src/core/sipe.h b/src/core/sipe.h index e7abd6e9..ba877764 100644 --- a/src/core/sipe.h +++ b/src/core/sipe.h @@ -53,7 +53,6 @@ struct sipe_account_data { /** Allowed server events to subscribe. From register OK response. */ GSList *allow_events; int presence_method_version; - time_t do_not_publish[SIPE_ACTIVITY_NUM_TYPES]; gchar *status; gchar *note; time_t note_since; -- 2.11.4.GIT