Example #1
1
 public void sendPhoto(final JsPeer peer, final JsFile file) {
   messenger.sendPhoto(peer.convert(), file);
 }
Example #2
0
  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();
              }
            });
  }
Example #3
0
 public void onConversationOpen(JsPeer peer) {
   messenger.onConversationOpen(peer.convert());
 }
Example #4
0
 public void unbindTyping(JsPeer peer, JsBindedValueCallback callback) {
   messenger.getTyping(peer.convert()).unsubscribe(callback);
 }
Example #5
0
 public JsTyping getTyping(JsPeer peer) {
   return messenger.getTyping(peer.convert()).get();
 }
Example #6
0
 public void onTyping(JsPeer peer) {
   messenger.onTyping(peer.convert());
 }
Example #7
0
 public String loadDraft(JsPeer peer) {
   return messenger.loadDraft(peer.convert());
 }
Example #8
0
 public void onMessageShown(JsPeer peer, JsMessage message) {
   if (message.isOnServer()) {
     messenger.onMessageShown(peer.convert(), Long.parseLong(message.getSortKey()));
   }
 }
Example #9
0
 public void changeNotificationsEnabled(JsPeer peer, boolean isEnabled) {
   messenger.changeNotificationsEnabled(peer.convert(), isEnabled);
 }
Example #10
0
 public void sendFile(JsPeer peer, JsFile file) {
   String descriptor = provider.registerUploadFile(file);
   messenger.sendDocument(peer.convert(), file.getName(), file.getMimeType(), descriptor);
 }
Example #11
0
 public void sendMessage(JsPeer peer, String text) {
   messenger.sendMessageWithMentionsDetect(peer.convert(), text);
 }
Example #12
0
 public JsPeer getGroupPeer(int gid) {
   return JsPeer.create(Peer.group(gid));
 }
Example #13
0
 public JsPeer getUserPeer(int uid) {
   return JsPeer.create(Peer.user(uid));
 }
Example #14
0
 public void onConversationClosed(JsPeer peer) {
   messenger.onConversationClosed(peer.convert());
 }
Example #15
0
 public void sendClipboardPhoto(final JsPeer peer, final JsBlob blob) {
   messenger.sendClipboardPhoto(peer.convert(), blob);
 }
Example #16
0
 public void onChatEnd(JsPeer peer) {
   messenger.loadMoreHistory(peer.convert());
 }
Example #17
0
 public void saveDraft(JsPeer peer, String text) {
   messenger.saveDraft(peer.convert(), text);
 }
Example #18
0
 public boolean isNotificationsEnabled(JsPeer peer) {
   return messenger.isNotificationsEnabled(peer.convert());
 }
Example #19
0
 public void unbindChat(JsPeer peer, JsDisplayListCallback<JsMessage> callback) {
   if (callback == null) {
     return;
   }
   messenger.getSharedChatList(peer.convert()).unsubscribeInverted(callback);
 }