B2G/gaia/apps/communications/dialer/js/call_log_db.js
/**
   * Removes the contact information matching the given contact id from the
   * list of groups or the contact information from a specific group.
   *
   * This function will likely be called within the handlers of the
   * 'oncontactchange' event.
   *
   * param contactId
   *        Contact identifier to be removed from the DB.
   * param group
   *        Group object to remove the contact info from.
   * param callback
   *        Function to be called after updating the group or when an error
   *        is found.
   *
   * return (via callback) count of affected records or an error message if
   *                       needed.
   */
Removes the contact information matching the given contact id from the
list of groups or the contact information from a specific group.

This function will likely be called within the handlers of the
'oncontactchange' event.

param contactId
Contact identifier to be removed from the DB.
param group
Group object to remove the contact info from.
param callback
Function to be called after updating the group or when an error
is found.

return (via callback) count of affected records or an error message if
needed.
Removes the contact information matching the given contact id from the list of groups or the contact information from a specific group . This function will likely be called within the handlers of the ' oncontactchange ' event . param contactId Contact identifier to be removed from the DB . param group Group object to remove the contact info from . param callback Function to be called after updating the group or when an error is found . return ( via callback ) count of affected records or an error message if needed .
function removeGroupContactInfo(contactId,
                                                          group,
                                                          callback) {
    if (!contactId && !group) {
      this._asyncReturn(callback, 0);
      return;
    }
    var self = this;
    this._newTxn('readwrite', [this._dbGroupsStore],
                 function(error, txn, store) {
      if (error) {
        self._asyncReturn(callback, error);
        callback(error);
        return;
      }
      var count = 0;
      var req;
      if (contactId) {
        req = store.index('contactId').openCursor(contactId);
      } else if (group) {
        var groupId = self._getGroupId(group);
        req = store.openCursor(groupId);
      }
      req.onsuccess = function onsuccess(event) {
        var cursor = event.target.result;
        if (cursor) {
          var group = cursor.value;
          if (group.contactId) {
            delete group.contactId;
          }
          if (group.contactPrimaryInfo) {
            delete group.contactPrimaryInfo;
          }
          if (group.contactMatchingTelType) {
            delete group.contactMatchingTelType;
          }
          if (group.contactMatchingTelCarrier) {
            delete group.contactMatchingTelCarrier;
          }
          if (group.contactPhoto) {
            delete group.contactPhoto;
          }
          cursor.update(group);
          count++;
          cursor.continue();
        } else {
          self._asyncReturn(callback, count);
          self._updateCacheRevision();
        }
      };
      req.onerror = function onerror(event) {
        self._asyncReturn(callback, event.target.error.name);
      };
    });
  }
function removeGroupContactInfo ( contactId , group , callback ) { if ( ! contactId && ! group ) { this . _asyncReturn ( callback , 0 ) ; return ; } var self = this ; this . _newTxn ( 'readwrite' , [ this . _dbGroupsStore ] , function ( error , txn , store ) { if ( error ) { self . _asyncReturn ( callback , error ) ; callback ( error ) ; return ; } var count = 0 ; var req ; if ( contactId ) { req = store . index ( 'contactId' ) . openCursor ( contactId ) ; } else if ( group ) { var groupId = self . _getGroupId ( group ) ; req = store . openCursor ( groupId ) ; } req . onsuccess = function onsuccess ( event ) { var cursor = event . target . result ; if ( cursor ) { var group = cursor . value ; if ( group . contactId ) { delete group . contactId ; } if ( group . contactPrimaryInfo ) { delete group . contactPrimaryInfo ; } if ( group . contactMatchingTelType ) { delete group . contactMatchingTelType ; } if ( group . contactMatchingTelCarrier ) { delete group . contactMatchingTelCarrier ; } if ( group . contactPhoto ) { delete group . contactPhoto ; } cursor . update ( group ) ; count ++ ; cursor . continue ( ) ; } else { self . _asyncReturn ( callback , count ) ; self . _updateCacheRevision ( ) ; } } ; req . onerror = function onerror ( event ) { self . _asyncReturn ( callback , event . target . error . name ) ; } ; } ) ; }
Removes the contact information matching the given contact id from the
 list of groups or the contact information from a specific group.
Removes the contact information matching the given contact id from the list of groups or the contact information from a specific group .