vCard minimal content required (#78)
Closed
Unknown opened 4 years ago

We require the following, minimum content supported in vCards for contacts:

  • email
  • firstName
  • lastName
  • role
  • phone
  • birthday date
  • timezone
  • street address
  • country address
  • city address
  • postal code address
  • region (maybe not mandatory)

As for the firstName/lastName I am not sure how related to this is currently supported structuredName and formattedName. Maybe this would be enough and we do not need first/last names. I am not sure at this point.

Unknown commented 4 years ago

What kind of "region" do you mean? I found it: in ADR attribute

Unknown commented 4 years ago

There is already 'VCardModule' in Halcyon. You can use it to retrieve vcards. It doesn't have all field you asked for. I'm adding those fields, but I found problem, because data structures and helper methods was prepared for getting information from vcards, not for setting. So I'm working on VCardBuilder.

Unknown commented 4 years ago

But we not always want to change a whole vcard, we may want to "update" parts of it by editing only some fields. Would it mean that with builder we would have to re-set all the fields to achieve that?

Unknown commented 4 years ago

Thank you Bartek. First, we need support to retrieve vcard and all required fields.

Setting vcard will also be needed but at later time.

Unknown commented 4 years ago

Implemented. Documentation is here.

Unknown commented 4 years ago

Thank you. I can use the current implementation and write the code as in examples.

However, I am a bit confused as to which API to use. From initial examples and documentation the library seems to prefer convention to register handlers for a specific event. Then send a request and expect a call back on the registered handler.

The examples linked above show a bit different way to provide handler directly in the request call. Why is this difference? Which way is preferred or recommended? Does the VCardModule allow for registering the handler for vCard requests?

Unknown commented 4 years ago

Handlers registration is for accepting events triggered by incoming stanzas, ie. incoming <message/>s. Providing handler directly in the request call is for "handling" response on stanza which was sent by this client, ie. for request-response mechanism used by <iq/>.

Unknown commented 4 years ago

Hm, ok, this makes sense. Thank you for explanation.

Unknown commented 4 years ago

Do I need to register handler for vCard module at all?

Unknown commented 4 years ago

Do you need to? No, but you should. VCard4 is PEP-based, so you may receive PubSub notification that new VCard was published and for that registered handler will be called.

Unknown commented 4 years ago

Ok, understand. Thanks a lot.

Unknown commented 4 years ago

All works as expected.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_libraries/halcyon#78
Please wait...
Page is in error, reload to recover