public List<Thread> getThreads(int type) { return getThreads(type, false); }
public Boolean userAuthenticatedThisSession () { return userAuthenticated() && authenticatedThisSession; }
public Single<Thread> createThread(List<User> users) { return createThread(null, users); }
public Observable<User> usersForIndex(final String value, final String index) { return usersForIndex(value, ChatSDK.config().contactsToLoadPerBatch, index); }
/** * @return the save auth id saved in the preference manager. * The preference manager is initialized when the NetworkManager.Init(context) is called. */ public String getCurrentUserEntityID() { return (String) getLoginInfo().get(AuthKeys.CurrentUserID); }
public Completable addUsersToThread(Thread thread, User... users) { return addUsersToThread(thread, Arrays.asList(users)); }
public Completable removeUsersFromThread(Thread thread, User... users) { return removeUsersFromThread(thread, Arrays.asList(users)); }
@Override public Completable addContact(User user, ConnectionType type) { addContactLocal(user, type); return Completable.complete(); }
@Override public Completable deleteContact(User user, ConnectionType type) { deleteContactLocal(user, type); return Completable.complete(); }
public static Message newMessage (MessageType type, Thread thread) { return newMessage(type.ordinal(), thread); }
public Observable<User> usersForIndexes(final String value, final String... indexes) { return usersForIndexes(value, ChatSDK.config().contactsToLoadPerBatch, indexes); }
@Override public Completable addContacts(ArrayList<User> users, ConnectionType type) { ArrayList<Completable> completables = new ArrayList<>(); for (User user : users) { completables.add(addContact(user, type)); } return Completable.concat(completables); }
@Override public Completable deleteContacts(ArrayList<User> users, ConnectionType type) { ArrayList<Completable> completables = new ArrayList<>(); for (User user : users) { completables.add(deleteContact(user, type)); } return Completable.concat(completables); }
@Override public boolean exists(User user) { for (User u : contacts()) { if (u.getEntityID().equals(user.getEntityID())) { return true; } } return false; }
@Override public void goOnline() { if (ChatSDK.lastOnline() != null) { ChatSDK.lastOnline().setLastOnline(currentUserModel()); } } }
public List<Thread> getThreads(int type, boolean allowDeleted) { return getThreads(type, allowDeleted, ChatSDK.config().showEmptyChats); }
public Observable<User> usersForIndex(final String value) { return usersForIndex(value, ChatSDK.config().contactsToLoadPerBatch); }
public Single<Thread> createThread(String name, User... users) { return createThread(name, Arrays.asList(users)); }
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; }
public Observable<User> usersForIndexes(String value, int limit, String... indexes) { ArrayList<Observable<User>> observables = new ArrayList<>(); for (String index : indexes) { observables.add(usersForIndex(value, limit, index)); } return Observable.merge(observables); }