lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
600 stars 65 forks source link

khard messages on startup #279

Closed fourstepper closed 3 years ago

fourstepper commented 3 years ago

I am getting a lot of these messages when running khard:

Wrapping vCard with unsupported version None, this might change any incompatible attributes.

I understand what this says and use khard read-only - is it possible to skip these warnings as of now?

d7415 commented 3 years ago

What version is the vCard? If it's not some custom version it would be nice to try to support it (though this is probably not the quickest solution to your problem).

fourstepper commented 3 years ago

I am not so experienced as far as vcard formats go - is there a way to find the vcard version out?

cat ~/.config/khard/khard.conf
# place it under ~/.config/khard/khard.conf
# This file is parsed by the configobj library.  The syntax is described at
# https://configobj.readthedocs.io/en/latest/configobj.html#the-config-file-format

[addressbooks]
[[default]]
path = ~/.contacts/default/

[general]
debug = no
default_action = list
# These are either strings or comma seperated lists
editor = vim, -i, NONE
merge_editor = vimdiff

[contact table]
# display names by first or last name: first_name / last_name / formatted_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# sort by first or last name: first_name / last_name / formatted_name
sort = last_name
# localize dates: yes / no
localize_dates = yes
# set a comma separated list of preferred phone number types in descending priority
# or nothing for non-filtered alphabetical order
preferred_phone_number_type = pref, cell, home
# set a comma separated list of preferred email address types in descending priority
# or nothing for non-filtered alphabetical order
preferred_email_address_type = pref, work, home

[vcard]
# extend contacts with your own private objects
# these objects are stored with a leading "X-" before the object name in the vcard files
# every object label may only contain letters, digits and the - character
# example:
#   private_objects = Jabber, Skype, Twitter
# default: ,  (the empty list)
private_objects = Jabber, Skype, Twitter
# preferred vcard version: 3.0 / 4.0
preferred_version = 3.0
# Look into source vcf files to speed up search queries: yes / no
search_in_source_files = no
# skip unparsable vcard files: yes / no
skip_unparsable = no

Here is my khal config

d7415 commented 3 years ago

Ah, sorry. It should be at (or near) the top of the vcf file. Something like VCARD 4.0 I think but I don't have any to hand right now. If I do before you answer I'll update accordingly.

fourstepper commented 3 years ago
BEGIN:VCARD
VERSION:3.0
PRODID:+//IDN bitfire.at//DAVx5/3.3.2-ose ez-vcard/0.11.0
UID:3be8cf57-eb7b-4ae2-90f1-ab6035b0cd65
FN:Default Name
N:Default Name;;;
ORG:Default ORG
TEL;TYPE=cell:+000 000 000 000
EMAIL;TYPE=home:email@example.com
REV:20201017T093612Z
END:VCARD

I have got one example vcard here - this is basically how all of them look for me - looks like it's VCARD 3.0

lucc commented 3 years ago

khard officially only suppoorts version 3 and 4 of the vcard standard because the vobject library we use does so.

The first thing to check is weather you have vcf files that do not specify their VERSION:..., I think these are some version 2.x files.

Support for new versions has to be implemented upstream but I think your chances are slim. One of the main reasons for version 3 was IIRC that the version 2.1 did not specify a version, was convoluted to parse and had to many different ways to represent the same things. Maybe you can convert your cards or use a program that produces more modern vcards (v3 is from 1998!). That said many times "conversion" is nearly o NoOp, just add the VERSION:3.0 line after BEGIN:VCARD (make backups!).

fourstepper commented 3 years ago

It seems that 3 of my contacts do not have VERSION specified, however when invoking khard, I get 42 lines of the Wrapping vCard with unsupported version None, this might change any incompatible attributes. message - I suspect most of my contacts being version 3 or 4, having a look at some of them at random

lucc commented 3 years ago

Can you create new address book folders to test how many new of these warnings you get for individual contacts that you add to the address book? You can restrict khard to one address book either with a custom config file or a command line option.

If you have a small address book you could use the debug option to find out what is going on.

In general you should just get one warning for one contact. And only if that contact is not v3 or v4. So I think we need to get to the bottom of where and why which warnings are generated for which cards.

By the way: which version of khard are you using?

fourstepper commented 3 years ago

I am on khard version 0.17.0

When looking closer, there seems to be those exact 42 contacts at version VERSION:2.1

I might just try to edit this as you said after a backup - thanks for the help, this is not a bug:)