Processing event about messages read

@param peer     peer
@param fromDate read from date
422628
public void onMessagesRead(Peer peer, long fromDate) {

        // Filtering obsolete read events
        if (fromDate < getLastReadDate(peer)) {
            return;
        }

        // Removing read messages from pending storage
        getNotifications().clear();
        pendingStorage.setMessagesCount(0);
        pendingStorage.setDialogsCount(0);
        allPendingNotifications.clear();
        saveStorage();
        updateNotification();

        // Setting last read date
        setLastReadDate(peer, fromDate);
    }
27186
public void doSendDocument(Peer peer, String fileName, String mimeType, int fileSize,
                               FastThumb fastThumb, String descriptor) {
        long rid = RandomUtils.nextRid();
        long date = createPendingDate();
        long sortDate = date + 365 * 24 * 60 * 60 * 1000L;
        DocumentContent documentContent = DocumentContent.createLocal(fileName, fileSize,
                descriptor, mimeType, fastThumb);

        Message message = new Message(rid, sortDate, date, myUid(), MessageState.PENDING, documentContent);
        context().getMessagesModule().getRouter().onOutgoingMessage(peer, message);

        pendingMessages.getPendingMessages().add(new PendingMessage(peer, rid, documentContent));
        savePending();

        performUploadFile(rid, descriptor, fileName);
    }
1073755
@ObjectiveCName("sendStickerWithPeer:withSticker:")
    public void sendSticker(Peer peer, Sticker sticker) {
        modules.getMessagesModule().sendSticker(peer, sticker);
    }
1310705
private void handleJoinEvent(Node node) {
    GossipMember member = new GossipMember(MemberId.from(node.id().id()), node.address());
    if (!members.containsKey(member.id())) {
      sendHeartbeat(member);
    }
  }
677644
@Override
	public boolean process(ContentEvent event) {
		if (event instanceof InstanceContentEvent) {
			this.processInstanceEvent((InstanceContentEvent) event);
		}
		else if (event instanceof PredicateContentEvent) {
			PredicateContentEvent pce = (PredicateContentEvent) event;
			if (pce.getRuleSplitNode() == null) {
				this.updateLearningNode(pce);
			}
			else {
				this.updateRuleSplitNode(pce);
			}
		}
		else if (event instanceof RuleContentEvent) {
			RuleContentEvent rce = (RuleContentEvent) event;
			if (rce.isRemoving()) {
				this.removeRule(rce.getRuleNumberID());
			}
			else {
				addRule(rce.getRule());
			}
		}
		return true;
	}
380777
public void setPublishDateString(String date) throws ParseException {
        if (StringUtils.isBlank(date)) {
            publishDate = null;
            return;
        }

        publishDate = dateFormat.parse(date);
    }
507627
public static Date readDate (final Parcel parcel) {
        final byte isADateStored = parcel.readByte();
        return (isADateStored == MARKER_AN_ELEMENT_STORED) ? new Date(parcel.readLong()) : null;
    }
475894
@Override
    public void onBusEvent(Event event) {
        if (event instanceof AppVisibleChanged) {
            AppVisibleChanged visibleChanged = (AppVisibleChanged) event;
            if (visibleChanged.isVisible()) {
                onAppVisible();
            } else {
                onAppHidden();
            }
        } else if (event instanceof PeerChatOpened) {
            onConversationVisible(((PeerChatOpened) event).getPeer());
        } else if (event instanceof PeerChatClosed) {
            onConversationHidden(((PeerChatClosed) event).getPeer());
        }
    }
1075147
function () {
      //retrive next messages.
      //TODO: respond to back pressure from streams to each peer.
      //if a given stream is paused, don't retrive more msgs
      //for that peer/stream.
      for(var id in this.state.peers) {
        var state = this.state.peers[id]
        while(state.retrive.length) {
          var id = state.retrive.shift()
          if(state.replicating[id])
            opts.getAt({id: id, sequence:state.replicating[id].sent+1}, this._retrive)
        }
      }
      if(this.state.receive.length) {
        var ev = this.state.receive.shift()
        opts.append(ev.value, function (err, data) {
          if(err) {
            if(this.logging) console.error('EBT:err', err)
            self.block(ev.value.author, ev.id, true)
          }
          else self.onAppend(ev.value)
        })
      }
      for(var k in this.streams)
        this.streams[k].resume()
    }
331058
private void notifyInactive(Peer peer) {
		for(Listener listener : new HashSet<>(listeners)) {
			listener.onInactive(peer);
		}
	}
1220592
@Override
    public void processMessage(AbsSender absSender, Message message, String[] arguments) {
        execute(absSender, message.getFrom(), message.getChat(), message.getMessageId(), arguments);
    }
197538
protected void processEvent (DEvent event)
    {
        // look up the target object
        DObject target = _objects.get(event.getTargetOid());
        if (target == null) {
            log.debug("Event target no longer exists", "event", event);
            return;
        }

        // check the event's permissions
        if (!target.checkPermissions(event)) {
            log.warning("Event failed permissions check", "event", event, "target", target);
            return;
        }

        if (dispatchEvent(event, target)) {
            // unless requested not to, notify any proxies
            target.notifyProxies(event);
        }
    }
960502
public void onConversationHidden(Peer peer) {
        if (visiblePeer != null && visiblePeer.equals(peer)) {
            this.visiblePeer = null;
        }
    }
1214051
@Override
  public void eventReceived(EventSubscriptionEntity eventSubscriptionEntity, Object payload, boolean processASync) {
    if (processASync) {
      scheduleEventAsync(eventSubscriptionEntity, payload);
    } else {
      processEventSync(eventSubscriptionEntity, payload);
    }
  }
782078
private void update(Peer peer) {
		String id = peer.getId();
		Peer previous = peers.get(id);
		switch(previous.getStatus()) {
			case ACTIVE:
				timeouts.get(id).cancel(true);
				timeouts.put(id, executor.schedule(new Deactivate(id), delay, MILLISECONDS));
				break;
			case INACTIVE:
				peers.put(peer.getId(), peer);
				timeouts.get(id).cancel(true);
				timeouts.put(id, executor.schedule(new Deactivate(id), delay, MILLISECONDS));
				notifyActive(peer);
				break;
			default:
				String error = "Unexpected peer status: " + previous.getStatus();
				throw new RuntimeException(error);
		}
	}
965600
@Override
    public void onMessageReceived(String from, Bundle data) {
        EasyGcm.Logger.d("Received message from: " + from);

        EasyGcm.getInstance().getGcmListener(getApplication()).onMessage(from, data);

    }
1351379
@ObjectiveCName("sendMessageWithPeer:withText:withMarkdownText:")
    public void sendMessage(@NotNull Peer peer, @NotNull String text, @Nullable String markDownText) {
        sendMessage(peer, text, markDownText, null, false);
    }