message: refactor: resource update
diff: @@ -134,18 +134,18 @@ export default class Contact implements IIdentifiable, IContact {
  public setPresence(resource: string, presence: Presence) {
  Log.debug('set presence for ' + this.jid.bare + ' / ' + resource, presence);
  + if (resource) {
  let resources = this.data.get('resources') || {};
  if (presence === Presence.offline) {
  - if (resource) {
  delete resources[resource];
  } else {
  - resources = {};
  - }
  - } else if (resource) {
  resources[resource] = presence;
  }
  + this.data.set('resources', resources);
  + }
  +
  presence = this.getHighestPresence();
  this.data.set('presence', presence);
  