Changeset 31ddc1


Ignore:
Timestamp:
Apr 9, 2008, 7:21:02 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
1e5198
Parents:
adc8f7
Message:

resolved problem with empty FullNames?; added dump Messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_rdfDatasource.js

    radc8f7 r31ddc1  
    106106        if (!vI_rdfDatasource.rdfDataSource) return null;
    107107        recDescription = recDescription.replace(/^\s+|\s+$/g,"")
    108         if (!recDescription) return null;
     108        if (!recDescription) {
     109            vI_notificationBar.dump("## vI_rdfDatasource: __getRDFResourceForVIdentity: no Recipient given.\n");
     110            return null;
     111        }
    109112        var rdfNSRecType = null
    110113        switch (recType) {
     
    117120   
    118121    removeVIdentityFromRDF : function (resource) {
     122        vI_notificationBar.dump("## vI_rdfDatasource: removeVIdentityFromRDF " + resource.ValueUTF8 + ".\n");
    119123        vI_rdfDatasource.__unsetRDFValue(resource, "email", vI_rdfDatasource.__getRDFValue(resource, "email"))
    120124        vI_rdfDatasource.__unsetRDFValue(resource, "fullName", vI_rdfDatasource.__getRDFValue(resource, "fullName"))
     
    124128   
    125129    __unsetRDFValue : function (resource, field, value) {
    126         if (!value) return; // return if some value was not set.
    127130        var predicate = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#" + field);
    128         var name = vI_rdfDatasource.rdfService.GetLiteral(value);
     131        var name = vI_rdfDatasource.rdfService.GetLiteral(value?value:"");
    129132        var target = vI_rdfDatasource.rdfDataSource.GetTarget(resource, predicate, true);
    130133        if (target instanceof Components.interfaces.nsIRDFLiteral)
     
    197200   
    198201    updateRDF : function (recDescription, recType, email, fullName, id, smtp) {
    199         if (!recDescription.replace(/^\s+|\s+$/g,"")) return;
    200         if (!email) return;
     202        if (!email) {
     203            vI_notificationBar.dump("## vI_rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n");
     204            return;
     205        }
    201206        var resource = vI_rdfDatasource.__getRDFResourceForVIdentity(recDescription, recType);
    202207        if (!resource) return null;
    203 
     208        vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8 + ".\n");
    204209        vI_rdfDatasource.__setRDFValue(resource, "email", email)
    205210        vI_rdfDatasource.__setRDFValue(resource, "fullName", fullName)
Note: See TracChangeset for help on using the changeset viewer.