public static Message newMessage (MessageType type, Thread thread) { return newMessage(type.ordinal(), thread); }
/** * 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()); }
return Observable.create((ObservableOnSubscribe<MessageSendProgress>) e -> { final Message message = AbstractThreadHandler.newMessage(MessageType.Image, thread);
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);