public void sendPhoto(final JsPeer peer, final JsFile file) { messenger.sendPhoto(peer.convert(), file); }
public void clearChat(JsPeer peer, final JsClosure success, final JsClosure error) { messenger .clearChat(peer.convert()) .start( new CommandCallback<Boolean>() { @Override public void onResult(Boolean res) { success.callback(); } @Override public void onError(Exception e) { error.callback(); } }); }
public void onConversationOpen(JsPeer peer) { messenger.onConversationOpen(peer.convert()); }
public void unbindTyping(JsPeer peer, JsBindedValueCallback callback) { messenger.getTyping(peer.convert()).unsubscribe(callback); }
public JsTyping getTyping(JsPeer peer) { return messenger.getTyping(peer.convert()).get(); }
public void onTyping(JsPeer peer) { messenger.onTyping(peer.convert()); }
public String loadDraft(JsPeer peer) { return messenger.loadDraft(peer.convert()); }
public void onMessageShown(JsPeer peer, JsMessage message) { if (message.isOnServer()) { messenger.onMessageShown(peer.convert(), Long.parseLong(message.getSortKey())); } }
public void changeNotificationsEnabled(JsPeer peer, boolean isEnabled) { messenger.changeNotificationsEnabled(peer.convert(), isEnabled); }
public void sendFile(JsPeer peer, JsFile file) { String descriptor = provider.registerUploadFile(file); messenger.sendDocument(peer.convert(), file.getName(), file.getMimeType(), descriptor); }
public void sendMessage(JsPeer peer, String text) { messenger.sendMessageWithMentionsDetect(peer.convert(), text); }
public JsPeer getGroupPeer(int gid) { return JsPeer.create(Peer.group(gid)); }
public JsPeer getUserPeer(int uid) { return JsPeer.create(Peer.user(uid)); }
public void onConversationClosed(JsPeer peer) { messenger.onConversationClosed(peer.convert()); }
public void sendClipboardPhoto(final JsPeer peer, final JsBlob blob) { messenger.sendClipboardPhoto(peer.convert(), blob); }
public void onChatEnd(JsPeer peer) { messenger.loadMoreHistory(peer.convert()); }
public void saveDraft(JsPeer peer, String text) { messenger.saveDraft(peer.convert(), text); }
public boolean isNotificationsEnabled(JsPeer peer) { return messenger.isNotificationsEnabled(peer.convert()); }
public void unbindChat(JsPeer peer, JsDisplayListCallback<JsMessage> callback) { if (callback == null) { return; } messenger.getSharedChatList(peer.convert()).unsubscribeInverted(callback); }