Tabnine Logo
AbstractThreadHandler.sendMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
sendMessage
method
in
co.chatsdk.core.base.AbstractThreadHandler

Best Java code snippets using co.chatsdk.core.base.AbstractThreadHandler.sendMessage (Showing top 1 results out of 315)

origin: chat-sdk/chat-sdk-android

/**
/* Convenience method to save the message to the database then pass it to the token network adapter
 * send method so it can be sent via the network
 */
public Observable<MessageSendProgress> implSendMessage(final Message message) {
  return Observable.create((ObservableOnSubscribe<MessageSendProgress>) e -> {
    message.update();
    message.getThread().update();
    if (ChatSDK.encryption() != null) {
      ChatSDK.encryption().encrypt(message);
    }
    e.onNext(new MessageSendProgress(message));
    e.onComplete();
  }).concatWith(sendMessage(message))
      .subscribeOn(Schedulers.single()).doOnComplete(() -> {
        message.setMessageStatus(MessageSendStatus.Sent);
        message.update();
      }).doOnError(throwable -> {
        message.setMessageStatus(MessageSendStatus.Failed);
        message.update();
      });
}
co.chatsdk.core.baseAbstractThreadHandlersendMessage

Javadoc

Preparing a text message, This is only the build part of the send from here the message will passed to "sendMessage" Method. From there the message will be uploaded to the server if the upload fails the message will be deleted from the local db. If the upload is successful we will update the message entity so the entityId given from the server will be saved. The message will be received before sending in the onMainFinished Callback with a Status that its in the sending process. When the message is fully sent the status will be changed and the onItem callback will be invoked. When done or when an error occurred the calling method will be notified.

Popular methods of AbstractThreadHandler

  • addUsersToThread
  • createThread
  • getThreads
  • implSendMessage
    /* Convenience method to save the message to the database then pass it to the token network adapter
  • loadMoreMessagesForThread
  • newMessage
  • removeUsersFromThread

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now