Don't encode telephone numbers if a contact doesn't have any number

This commit is contained in:
Marco Castelluccio 2014-11-20 01:12:47 +01:00
Родитель f5f1f77ab2
Коммит 6f8b9b6c4c
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -276,14 +276,16 @@ NokiaContactsLocalMsgConnection.prototype.encodeContact = function(encoder, cont
encoder.put(DataType.WSTRING, "DisplayName", contact.name[0]);
encoder.putStart(DataType.ARRAY, "Numbers");
contact.tel.forEach(function(tel) {
encoder.putStart(DataType.LIST, "NumbersList"); // The name of this field is unknown
// encoder.put(DataType.ULONG, "Kind", ???); // The meaning of this field is unknown
encoder.put(DataType.WSTRING, "Number", tel.value);
encoder.putEnd(DataType.LIST, "NumbersList");
});
encoder.putEnd(DataType.ARRAY, "Numbers");
if (contact.tel) {
encoder.putStart(DataType.ARRAY, "Numbers");
contact.tel.forEach(function(tel) {
encoder.putStart(DataType.LIST, "NumbersList"); // The name of this field is unknown
// encoder.put(DataType.ULONG, "Kind", ???); // The meaning of this field is unknown
encoder.put(DataType.WSTRING, "Number", tel.value);
encoder.putEnd(DataType.LIST, "NumbersList");
});
encoder.putEnd(DataType.ARRAY, "Numbers");
}
encoder.putEnd(DataType.LIST, "Contact");
}