gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-50


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-508-g5030fa6
Date: Sun, 28 Apr 2013 21:00:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  5030fa6a64baaea2083cdae3757d01c8781a9610 (commit)
      from  76fe58a8d5cd8d097b7d6db90459e54f14c8a8c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=5030fa6a64baaea2083cdae3757d01c8781a9610


commit 5030fa6a64baaea2083cdae3757d01c8781a9610
Author: Daniele Forsi <address@hidden>
Date:   Sat Apr 27 18:58:56 2013 +0200

    Use the default phone number also if there isn't one in a subentry
    
    Previously entry->number was used only if there where no subentries, now use
    it also when there isn't a subentry with a GN_PHONEBOOK_ENTRY_Number. Both
    are present when phonebook is read by nk6510/nk7110 because 
phonebook_decode()
    copies the first number found in a subentry (which is probably a different 
bug
    because subblock_count is incremented also when reading other types of data
    such as email or job title so it depends on the order of sub blocks in the
    FBUS frame):
    if (!subblock_count)
        snprintf(data->phonebook_entry->number, 
sizeof(data->phonebook_entry->number), "%s", subentry->data.number);
    
    The phone number from this vCard is ignored without this commit:
    BEGIN:VCARD
    VERSION:3.0
    FN:Given name
    N:;Given name
    TEL;TYPE=PREF,VOICE:1234567890
    X-GSM-MEMORY:ME
    X-GSM-LOCATION:1000
    X-GSM-CALLERGROUP:5
    CATEGORIES:None
    END:VCARD

diff --git a/ChangeLog b/ChangeLog
index 4fda4d5..87629b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,8 @@
     o use libusb to detach cdc_phonet or any other linux kernel
       module; modprobe blacklisting isn't needed anymore
                                                     (Daniele Forsi)
+    o write phone number read from TEL;TYPE=PREF,VOICE of a vCard
+      when there is no other number in subentries   (Daniele Forsi)
  * xgnokii updates
     o fix bug that caused to forget subentries after the first one
       when editing the phonebook                    (Daniele Forsi)
@@ -81,6 +83,8 @@
     o change the value used for VOICE phonebook memory, containing
       the phone number(s) to be used to listen to voicemail, which
       was used for MT which now is unsupported      (Daniele Forsi)
+    o write phone number read from TEL;TYPE=PREF,VOICE of a vCard
+      when there is no other number in subentries   (Daniele Forsi)
  * gnokii updates
     o fix --getfile --getfilebyid --getallfiles and --getmms on
       non-POSIX sistems (eg. Windows)               (Daniele Forsi)
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index a963af9..fd672f0 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -3085,30 +3085,28 @@ retry:
                /* We don't require the application to fill in any subentry.
                 * if it is not filled in, let's take just one number we have.
                 */
-               if (!entry->subentries_count) {
-                       string[0] = GN_PHONEBOOK_NUMBER_General;
-                       string[1] = string[2] = string[3] = 0;
-                       j = strlen(entry->number);
-                       j = char_unicode_encode((string + 5), entry->number, j);
-                       string[j + 1] = 0;
-                       string[4] = j;
-                       count += PackBlock(0x0b, j + 5, &block, string, req + 
count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count);
-               } else {
+               {
                        /* Default Number */
-                       defaultn = 999;
+                       const char *number;
+                       defaultn = -1;
                        for (i = 0; i < entry->subentries_count; i++)
                                if (entry->subentries[i].entry_type == 
GN_PHONEBOOK_ENTRY_Number)
                                        if (!strcmp(entry->number, 
entry->subentries[i].data.number))
                                                defaultn = i;
-                       if (defaultn < i) {
+                       if (defaultn >= 0) {
                                string[0] = 
entry->subentries[defaultn].number_type;
-                               string[1] = string[2] = string[3] = 0;
-                               j = 
strlen(entry->subentries[defaultn].data.number);
-                               j = char_unicode_encode((string + 5), 
entry->subentries[defaultn].data.number, j);
-                               string[j + 1] = 0;
-                               string[4] = j;
-                               count += PackBlock(0x0b, j + 5, &block, string, 
req + count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count);
+                               number = 
entry->subentries[defaultn].data.number;
+                       } else {
+                               string[0] = GN_PHONEBOOK_NUMBER_General;
+                               number = entry->number;
                        }
+                       string[1] = string[2] = string[3] = 0;
+                       j = char_unicode_encode((string + 5), number, 
strlen(number));
+                       string[j + 1] = 0;
+                       string[4] = j;
+                       count += PackBlock(0x0b, j + 5, &block, string, req + 
count, GN_PHONEBOOK_ENTRY_MAX_LENGTH - count);
+               }
+               if (entry->subentries_count) {
                        /* Rest of the numbers */
                        for (i = 0; i < entry->subentries_count; i++) {
                                int duplicate = 0;
diff --git a/common/phones/nk7110.c b/common/phones/nk7110.c
index 8ab8eee..58eefc6 100644
--- a/common/phones/nk7110.c
+++ b/common/phones/nk7110.c
@@ -886,28 +886,27 @@ static gn_error NK7110_WritePhonebookLocation(gn_data 
*data, struct gn_statemach
                /* We don't require the application to fill in any subentry.
                 * if it is not filled in, let's take just one number we have.
                 */
-               if (!entry->subentries_count) {
-                       string[0] = GN_PHONEBOOK_ENTRY_Number;
-                       string[1] = string[2] = string[3] = 0;
-                       j = strlen(entry->number);
-                       j = char_unicode_encode((string + 5), entry->number, j);
-                       string[4] = j;
-                       count += PackBlock(0x0b, j + 5, block++, string, req + 
count);
-               } else {
+               {
                        /* Default Number */
-                       defaultn = 999;
+                       const char *number;
+                       defaultn = -1;
                        for (i = 0; i < entry->subentries_count; i++)
                                if (entry->subentries[i].entry_type == 
GN_PHONEBOOK_ENTRY_Number)
                                        if (!strcmp(entry->number, 
entry->subentries[i].data.number))
                                                defaultn = i;
-                       if (defaultn < i) {
+                       if (defaultn >= 0) {
                                string[0] = 
entry->subentries[defaultn].number_type;
-                               string[1] = string[2] = string[3] = 0;
-                               j = 
strlen(entry->subentries[defaultn].data.number);
-                               j = char_unicode_encode((string + 5), 
entry->subentries[defaultn].data.number, j);
-                               string[4] = j;
-                               count += PackBlock(0x0b, j + 5, block++, 
string, req + count);
+                               number = 
entry->subentries[defaultn].data.number;
+                       } else {
+                               string[0] = GN_PHONEBOOK_ENTRY_Number;
+                               number = entry->number;
                        }
+                       string[1] = string[2] = string[3] = 0;
+                       j = char_unicode_encode((string + 5), number, 
strlen(number));
+                       string[4] = j;
+                       count += PackBlock(0x0b, j + 5, block++, string, req + 
count);
+               }
+               if (entry->subentries_count) {
                        /* Rest of the numbers */
                        for (i = 0; i < entry->subentries_count; i++)
                                if (entry->subentries[i].entry_type == 
GN_PHONEBOOK_ENTRY_Number) {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    4 ++++
 common/phones/nk6510.c |   32 +++++++++++++++-----------------
 common/phones/nk7110.c |   29 ++++++++++++++---------------
 3 files changed, 33 insertions(+), 32 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]