Codota Logo
AbstractThreadHandler
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: chat-sdk/chat-sdk-android

public Completable addUsersToThread(Thread thread, User... users) {
  return addUsersToThread(thread, Arrays.asList(users));
}
origin: chat-sdk/chat-sdk-android

public Single<Thread> createThread(List<User> users) {
  return createThread(null, users);
}
origin: chat-sdk/chat-sdk-android

public List<Thread> getThreads(int type) {
  return getThreads(type, false);
}
origin: chat-sdk/chat-sdk-android

/**
 * 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.
 */
public Observable<MessageSendProgress> sendMessageWithText(final String text, final Thread thread) {
  return Observable.create((ObservableOnSubscribe<MessageSendProgress>) e -> {
    final Message message = newMessage(MessageType.Text, thread);
    message.setText(text);
    e.onNext(new MessageSendProgress(message));
    ObservableConnector<MessageSendProgress> connector = new ObservableConnector<>();
    connector.connect(implSendMessage(message), e);
  }).subscribeOn(Schedulers.single());
}
origin: chat-sdk/chat-sdk-android

public static Message newMessage (MessageType type, Thread thread) {
  return newMessage(type.ordinal(), thread);
}
origin: chat-sdk/chat-sdk-android

public Completable removeUsersFromThread(Thread thread, User... users) {
  return removeUsersFromThread(thread, Arrays.asList(users));
}
origin: chat-sdk/chat-sdk-android

public Single<List<Message>> loadMoreMessagesForThread(final Message fromMessage, final Thread thread) {
  return super.loadMoreMessagesForThread(fromMessage, thread).flatMap(messages -> {
    if (messages.isEmpty()) {
      return new ThreadWrapper(thread).loadMoreMessages(fromMessage, ChatSDK.config().messagesToLoadPerBatch);
    }
    return Single.just(messages);
  });
}
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();
      });
}
origin: chat-sdk/chat-sdk-android

return Observable.create((ObservableOnSubscribe<MessageSendProgress>) e -> {
  final Message message = AbstractThreadHandler.newMessage(MessageType.Image, thread);
origin: chat-sdk/chat-sdk-android

public List<Thread> getThreads(int type, boolean allowDeleted) {
  return getThreads(type, allowDeleted, ChatSDK.config().showEmptyChats);
}
origin: chat-sdk/chat-sdk-android

public Observable<MessageSendProgress> sendMessageWithLocation(final String filePath, final LatLng location, final Thread thread) {
  return Observable.create((ObservableOnSubscribe<MessageSendProgress>) e -> {
    final Message message = AbstractThreadHandler.newMessage(MessageType.Location, thread);
origin: chat-sdk/chat-sdk-android

public Single<Thread> createThread(String name, User... users) {
  return createThread(name, Arrays.asList(users));
}
origin: chat-sdk/chat-sdk-android

public int getUnreadMessagesAmount(boolean onePerThread){
  List<Thread> threads = getThreads(ThreadType.Private, false);
  int count = 0;
  for (Thread t : threads) {
    if (onePerThread) {
      if(!t.isLastMessageWasRead()) {
        count++;
      }
    }
    else {
      count += t.getUnreadMessagesCount();
    }
  }
  return count;
}
co.chatsdk.core.baseAbstractThreadHandler

Javadoc

Created by benjaminsmiley-andrews on 25/05/2017.

Most used methods

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSharedPreferences (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • JLabel (javax.swing)
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now