From 2656249bf90605b39242d2f0174e9dc96de23fcb Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Mon, 8 Apr 2013 22:24:46 +0300 Subject: [PATCH] notify: factor out code path only used by one caller process_incoming_notify() with request == TRUE and benotify == FALSE is only used by one caller. Factor out the code path and move it to caller instead. --- src/core/sip-transport.c | 5 +++-- src/core/sipe-notify.c | 10 +--------- src/core/sipe-notify.h | 5 ++--- src/core/sipe-subscriptions.c | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/core/sip-transport.c b/src/core/sip-transport.c index 7f14607f..69775cd0 100644 --- a/src/core/sip-transport.c +++ b/src/core/sip-transport.c @@ -1426,10 +1426,11 @@ static void process_input_message(struct sipe_core_private *sipe_private, process_incoming_message(sipe_private, msg); } else if (sipe_strequal(method, "NOTIFY")) { SIPE_DEBUG_INFO_NOFORMAT("send->process_incoming_notify"); - process_incoming_notify(sipe_private, msg, TRUE, FALSE); + process_incoming_notify(sipe_private, msg, TRUE); + sip_transport_response(sipe_private, msg, 200, "OK", NULL); } else if (sipe_strequal(method, "BENOTIFY")) { SIPE_DEBUG_INFO_NOFORMAT("send->process_incoming_benotify"); - process_incoming_notify(sipe_private, msg, TRUE, TRUE); + process_incoming_notify(sipe_private, msg, TRUE); } else if (sipe_strequal(method, "INVITE")) { process_incoming_invite(sipe_private, msg); } else if (sipe_strequal(method, "REFER")) { diff --git a/src/core/sipe-notify.c b/src/core/sipe-notify.c index 67944df9..56855bed 100644 --- a/src/core/sipe-notify.c +++ b/src/core/sipe-notify.c @@ -38,7 +38,6 @@ #include "sipmsg.h" #include "sip-csta.h" #include "sip-soap.h" -#include "sip-transport.h" #include "sipe-backend.h" #include "sipe-buddy.h" #include "sipe-cal.h" @@ -1668,8 +1667,7 @@ static void sipe_process_presence_timeout(struct sipe_core_private *sipe_private */ void process_incoming_notify(struct sipe_core_private *sipe_private, struct sipmsg *msg, - gboolean request, - gboolean benotify) + gboolean request) { const gchar *content_type = sipmsg_find_header(msg, "Content-Type"); const gchar *event = sipmsg_find_header(msg, "Event"); @@ -1779,12 +1777,6 @@ void process_incoming_notify(struct sipe_core_private *sipe_private, } } } - - /* The client responses on received a NOTIFY message */ - if (request && !benotify) - { - sip_transport_response(sipe_private, msg, 200, "OK", NULL); - } } /* diff --git a/src/core/sipe-notify.h b/src/core/sipe-notify.h index b84ef738..1a373606 100644 --- a/src/core/sipe-notify.h +++ b/src/core/sipe-notify.h @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2011 SIPE Project + * Copyright (C) 2011-2013 SIPE Project * * * This program is free software; you can redistribute it and/or modify @@ -27,8 +27,7 @@ struct sipe_core_private; void process_incoming_notify(struct sipe_core_private *sipe_private, struct sipmsg *msg, - gboolean request, - gboolean benotify); + gboolean request); /* Local Variables: diff --git a/src/core/sipe-subscriptions.c b/src/core/sipe-subscriptions.c index a974bbe9..63048545 100644 --- a/src/core/sipe-subscriptions.c +++ b/src/core/sipe-subscriptions.c @@ -179,7 +179,7 @@ static gboolean process_subscribe_response(struct sipe_core_private *sipe_privat g_free(with); if (sipmsg_find_header(msg, "ms-piggyback-cseq")) - process_incoming_notify(sipe_private, msg, FALSE, FALSE); + process_incoming_notify(sipe_private, msg, FALSE); return(TRUE); } -- 2.11.4.GIT