Repository navigation
feat: LegacyMessaging dialect - #19
Merged
Merged
Conversation
Reads and writes the instant messaging properties address books wrote before IMPP, such as X-AIM or X-JABBER, as online services with a service and a user name. The encoder now applies dialects in reverse order, so that the same list works both ways. The helpers dialects share move to an internal class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third step of the vendor layer: the
LegacyMessagingdialect, for the instant messaging properties address books wrote before IMPP (RFC 4770), and still write.Reading
X-AIMX-ICQX-JABBERX-MSNX-YAHOOX-SKYPE,X-SKYPE-USERNAMEX-QQX-GOOGLE-TALK,X-GTALKX-GADUGADUX-SIPX-AIM;TYPE=home:jdoeis read asSOCIALPROFILE;VALUE=text;SERVICE-TYPE=AIM;TYPE=home:jdoe(RFC 9554). In JSContact, that is an online service withserviceanduser. The value is a user name, so no URI such asaim:jdoeis made up. The service names are the ones Apple writes inX-SERVICE-TYPE.Writing
A text online service (a user, no URI) of one of these services is written back as its property. When two properties exist for a service, the more common one is used:
X-SKYPE,X-GOOGLE-TALK. Other services, and services with a URI, stay as they are.Dialect order
The encoder now applies dialects in the reverse order of the list, so the same list works both ways. With
[new Apple(), new LegacyMessaging()],LegacyMessagingwritesX-AIMbefore Apple turns the remaining text profiles intoX-SOCIALPROFILE.Refactoring
The helpers both dialects use move to the internal
Dialect\Internal\VCardEditclass.Tests
The Android export converts to online services, contexts and preference are kept, Cards are written back, the write order is checked, and four real exports survive a round trip through
[Apple, LegacyMessaging].🤖 Generated with Claude Code