Cannot retreive contacts from SOGo
ClosedPublic

Authored by McPain on Jul 31 2017, 12:01 PM.

Details

Summary

VCards in SOGo are represented without trailing newlines after END:VCARD
kcontacts parser doesn't expect this and on reaching "END:VCARD" text.indexOf('\n', lineStart) will return '-1' and that breaks 'for' loop.

Fixed behavior: if text.indexOf('\n', lineStart) returns -1 [there are no more newlines] lineEnd will be set to the returned value of text.size()

Diff Detail

Repository
R174 KContacts
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
McPain created this revision.Jul 31 2017, 12:01 PM
mlaurent requested changes to this revision.Jul 31 2017, 12:15 PM
mlaurent added a subscriber: mlaurent.

Please add autotest for it.

This revision now requires changes to proceed.Jul 31 2017, 12:15 PM
McPain requested review of this revision.EditedJul 31 2017, 1:09 PM
McPain edited edge metadata.

How I can run autotests?

UPD
I successfully ran the tests

McPain updated this revision to Diff 17430.Jul 31 2017, 2:05 PM

Added autotests

mlaurent accepted this revision.Aug 1 2017, 5:09 AM

Thanks.
Could you commit it in 17.08 and using git merge for merging in master ?
thanks

This revision is now accepted and ready to land.Aug 1 2017, 5:09 AM
McPain added a comment.EditedAug 1 2017, 7:24 AM

Thanks.
Could you commit it in 17.08 and using git merge for merging in master ?
thanks

I think I have no permissions to commit in 17.08

Ok I will do it for you at noon.
Thanks

This revision was automatically updated to reflect the committed changes.