Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCHv1 3/5] service: Fill conversation list with messages
Date: Fri, 27 Apr 2012 14:25:22 +0200	[thread overview]
Message-ID: <1335529522.16897.470.camel@aeonflux> (raw)
In-Reply-To: <1335344513-2347-4-git-send-email-ronald.tessier@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

Hi Ronald,

> ---
>  src/service.c |   88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 87 insertions(+), 1 deletions(-)
> 
> diff --git a/src/service.c b/src/service.c
> index 18c11f4..2787c3a 100644
> --- a/src/service.c
> +++ b/src/service.c
> @@ -719,13 +719,85 @@ static gboolean get_conversation_get_args(DBusMessage *dbus_msg,
>  	return TRUE;
>  }
> 
> +static gboolean is_recipient(const char *recipients, const char *number)
> +{
> +	const char *rec, *num;
> +
> +	while (*recipients != '\0') {
> +		rec = recipients;
> +		num = number;
> +
> +		while (*rec != '\0' && *num != '\0') {
> +			if (*rec == *num) {
> +				rec++;
> +				num++;
> +			} else {
> +				if (*rec == '-' || *rec == '.') {
> +					rec++;
> +					continue;
> +				}
> +
> +				if (*num == '-' || *num == '.') {
> +					num++;
> +					continue;
> +				}
> +
> +				rec++;
> +				break;
> +			}
> +		}
> +
> +		/*
> +		 * Phone numbers in recipients end with /TYPE=PLMN, so the
> +		 * wanted number is found if the whole string number is found
> +		 * and if the matched phone number ends with the wanted number
> +		 * (i.e.: "/TYPE=PLMN" must follow).
> +		 */
> +		if (*num == '\0' && *rec == '/')
> +			return TRUE;
> +
> +		recipients = rec;
> +	}
> +
> +	return FALSE;
> +}

please explain what this function is actually doing? Adding a comment
seems like a good idea here.

Regards

Marcel



  reply	other threads:[~2012-04-27 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25  9:01 [PATCHv1 0/5] mmsd: GetConversation support Ronald Tessier
2012-04-25  9:01 ` [PATCHv1 1/5] service: Add GetConversation method Ronald Tessier
2012-04-27 12:26   ` Marcel Holtmann
2012-04-25  9:01 ` [PATCHv1 2/5] service: Retrieve get_conversation() args Ronald Tessier
2012-04-27 12:25   ` Marcel Holtmann
2012-04-25  9:01 ` [PATCHv1 3/5] service: Fill conversation list with messages Ronald Tessier
2012-04-27 12:25   ` Marcel Holtmann [this message]
2012-04-25  9:01 ` [PATCHv1 4/5] service: Sort conversation list by message date Ronald Tessier
2012-04-27 12:23   ` Marcel Holtmann
2012-04-25  9:01 ` [PATCHv1 5/5] doc: Update service-api.txt Ronald Tessier
2012-04-27 12:20   ` Marcel Holtmann
2012-04-27 13:30     ` Ronald Tessier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335529522.16897.470.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox