Skip to content

Commit

Permalink
imp - Fetch the last dot for property grouping
Browse files Browse the repository at this point in the history
---

We need to get the last dot from the prefix when parsing grouped properties.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 9, 2024
1 parent afa9818 commit 2e6f9a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions VisualCard.ShowContacts/TestFiles/VCard4GroupProps.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ BEGIN:VCARD
VERSION:4.0
UID:urn:uuid:136c1090-d7d3-4399-9f59-8f7a7b6e2ef1
ADR;TYPE=home:;;New York\, USA;;;;
A.EMAIL;TYPE=HOME:[email protected]
B.EMAIL;TYPE=WORK:[email protected]
E.A.EMAIL;TYPE=HOME:[email protected]
E.B.EMAIL;TYPE=WORK:[email protected]
FN:Sarah Santos
N:Santos;Sarah;;;
ORG:Support Scammer Outcry Organization
A.TEL;TYPE=cell:589-210-1059
B.TEL;TYPE=cell:589-210-1058
T.A.TEL;TYPE=cell:589-210-1059
T.B.TEL;TYPE=cell:589-210-1058
TITLE:Chief Executive Officer
URL:https://sso.org/
X-SIP-SIP:sip test
S.URL:https://sso.org/
S.X-SIP-SIP:sip test
ANNIVERSARY:20230406
GENDER:F;grrrl
DRESSCODE:CASUAL
Expand Down
2 changes: 1 addition & 1 deletion VisualCard.ShowContacts/TestFiles/fourVCard4.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ADR;TYPE=home:;;Street Address;;;;
EMAIL;TYPE=HOME:[email protected]
EMAIL;TYPE=WORK:[email protected]
FN:Neville Navasquillo
A.IMPP;TYPE=HOME:aim:IM
IMPP;TYPE=HOME:aim:IM
IMPP;TYPE=HOME:msn:Windows LIVE
IMPP;TYPE=HOME:ymsgr:Yahoo
N;ALTID=0;LANGUAGE=en:Navasquillo;Neville;Neville\,Nevile;Mr.;Jr.
Expand Down
4 changes: 2 additions & 2 deletions VisualCard/Parsers/Arguments/PropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PropertyInfo : IEquatable<PropertyInfo?>
prefix;

/// <summary>
/// Property group
/// Property group (dots are for nested groups)
/// </summary>
public string Group =>
group;
Expand Down Expand Up @@ -125,7 +125,7 @@ internal PropertyInfo(string line)
var finalArgs = splitArgs.Select((arg) => new ArgumentInfo(arg)).ToArray();

// Extract the group name
string group = prefix.Contains(".") ? prefix.Substring(0, prefix.IndexOf(".")) : "";
string group = prefix.Contains(".") ? prefix.Substring(0, prefix.LastIndexOf(".")) : "";
prefix = prefix.RemovePrefix($"{group}.");

// Check to see if this is a nonstandard prefix
Expand Down

0 comments on commit 2e6f9a2

Please sign in to comment.