Skip to content

Commit

Permalink
jmap_contact: rename "nickName" property to "nickname"
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Stepanek <[email protected]>
  • Loading branch information
rsto authored and ksmurchison committed Aug 10, 2023
1 parent e220477 commit 4bb5d40
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions cassandane/tiny-tests/JMAPContacts/card-copy
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ sub test_card_copy
id => $cardId,
addressBookId => "Default",
# avatar => JSON::null,
nickNames => { n1 => { '@type' => 'NickName', name => "xxxxx" } }
nicknames => { n1 => { '@type' => 'Nickname', name => "xxxxx" } }
},
}
},
Expand All @@ -160,7 +160,7 @@ sub test_card_copy
}, 'R2'],
]);
$self->assert_str_equals('foo bar', $res->[0][1]{list}[0]{name}{full});
$self->assert_str_equals('xxxxx', $res->[0][1]{list}[0]{nickNames}{n1}{name});
$self->assert_str_equals('xxxxx', $res->[0][1]{list}[0]{nicknames}{n1}{name});
# $self->assert_null($res->[0][1]{list}[0]{avatar});
return;
my $other3Jmap = Mail::JMAPTalk->new(
Expand Down
4 changes: 2 additions & 2 deletions cassandane/tiny-tests/JMAPContacts/card-query
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sub test_card_query
surname => 'aaa'
}
},
nickNames => {
nicknames => {
'n1' => {
name => "foo"
}
Expand Down Expand Up @@ -176,7 +176,7 @@ sub test_card_query
},
]
},
nickNames => {
nicknames => {
'n1' => {
name => "bam"
}
Expand Down
4 changes: 2 additions & 2 deletions cassandane/tiny-tests/JMAPContacts/card-query-shared
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sub test_card_query_shared
surname => 'aaa'
}
},
nickNames => {
nicknames => {
'n1' => {
name => "foo"
}
Expand Down Expand Up @@ -198,7 +198,7 @@ sub test_card_query_shared
},
]
},
nickNames => {
nicknames => {
'n1' => {
name => "bam"
}
Expand Down
4 changes: 2 additions & 2 deletions cassandane/tiny-tests/JMAPContacts/card-set-create-nicknames
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ sub test_card_set_create_nicknames
version => '1.0',
uid => $id,
name => { full => 'John Doe' },
nickNames => {
nicknames => {
k391 => {
'@type' => 'NickName',
'@type' => 'Nickname',
name => 'Johnny'
}
}
Expand Down
12 changes: 6 additions & 6 deletions cassandane/tiny-tests/JMAPContacts/card-set-update
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ sub test_card_set_update
version => '1.0',
uid => $id,
name => { full => 'John Doe' },
nickNames => {
nicknames => {
k391 => {
'@type' => 'NickName',
'@type' => 'Nickname',
name => 'Johnny'
}
}
Expand All @@ -47,9 +47,9 @@ sub test_card_set_update
['ContactCard/set', {
update => {
$id => {
'nickNames/k391/name' => 'Johnny Boy',
'nickNames/foo' => {
'@type' => 'NickName',
'nicknames/k391/name' => 'Johnny Boy',
'nicknames/foo' => {
'@type' => 'Nickname',
name => 'Doey'
}
}
Expand All @@ -73,7 +73,7 @@ sub test_card_set_update
['ContactCard/set', {
update => {
$id => {
'nickNames/k391' => JSON::null
'nicknames/k391' => JSON::null
}
}
}, "R2"]
Expand Down
4 changes: 2 additions & 2 deletions cassandane/tiny-tests/JMAPContacts/cardgroup-query
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sub test_cardgroup_query
surname => 'aaa'
}
},
nickNames => {
nicknames => {
'n1' => {
name => "foo"
}
Expand Down Expand Up @@ -166,7 +166,7 @@ sub test_cardgroup_query
},
]
},
nickNames => {
nicknames => {
'n1' => {
name => "bam"
}
Expand Down
10 changes: 5 additions & 5 deletions imap/jmap_contact.c
Original file line number Diff line number Diff line change
Expand Up @@ -5608,7 +5608,7 @@ static const jmap_property_t card_props[] = {
0
},
{
"nickNames",
"nicknames",
NULL,
0
},
Expand Down Expand Up @@ -6540,7 +6540,7 @@ static void jsprop_from_vcard(vcardproperty *prop, json_t *obj,
}

case VCARD_NICKNAME_PROPERTY: {
json_t *nicks = json_object_get_vanew(obj, "nickNames", "{}");
json_t *nicks = json_object_get_vanew(obj, "nicknames", "{}");
vcardstrarray *names = vcardproperty_get_nickname(prop);
size_t i;

Expand Down Expand Up @@ -7898,7 +7898,7 @@ static int card_filter_match(void *vf, void *rock)
f->text, &cfrock->cached_termsets) ||
!card_filter_match_namecomp(card, "suffix", f->suffix,
f->text, &cfrock->cached_termsets) ||
!card_filter_match_listprop(card, "nickNames", NULL,
!card_filter_match_listprop(card, "nicknames", NULL,
name_vals, f->nickName,
f->text, &cfrock->cached_termsets) ||
!card_filter_match_listprop(card, "titles", "title",
Expand Down Expand Up @@ -10222,9 +10222,9 @@ static int _jscard_to_vcard(struct jmap_req *req,
}
record_is_dirty |= _jsname_to_vcard(&parser, jval, &l10n, card);
}
else if (!strcmp(mykey, "nickNames")) {
else if (!strcmp(mykey, "nicknames")) {
record_is_dirty |= _jsmultiobject_to_card(&parser, jval,
mykey, "NickName",
mykey, "Nickname",
&_jsnickname_to_vcard,
WANT_PROPID_FLAG,
pref_param_props, &l10n,
Expand Down

0 comments on commit 4bb5d40

Please sign in to comment.