Esempio n. 1
0
  /**
   * Update details of a particular user
   *
   * @param userId The user's ID
   * @param name User fields;
   */
  public Users updateUser(
      long userId,
      String name,
      String bio,
      String baseLayer,
      boolean isTwitterAutoPost,
      boolean isInstagramAutoPost,
      boolean isTwitterAutoPostRetweets,
      @SessionToken String sessionToken) {
    checkId(userId);
    // Not sure how to send boolean value to the server. So turn true to 1 and false to 0
    final int twitterAutoPost = isTwitterAutoPost ? 1 : 0;
    final int instagramAutoPost = isInstagramAutoPost ? 1 : 0;
    final int twitterAutoPostRetweet = isTwitterAutoPostRetweets ? 1 : 0;

    return mUserInterface.updateUser(
        userId,
        name,
        bio,
        baseLayer,
        twitterAutoPost,
        instagramAutoPost,
        twitterAutoPostRetweet,
        sessionToken);
  }
Esempio n. 2
0
 /**
  * Get a user by the ID
  *
  * @return The User
  */
 public Users getUser(long userId) {
   checkId(userId);
   return mUserInterface.getUser(userId);
 }
Esempio n. 3
0
 /**
  * Get Posts a particular user has created
  *
  * @param userId The user's ID
  * @return Posts the user has created
  */
 public Posts getUsersPosts(long userId) {
   checkId(userId);
   return mUserInterface.getUsersPosts(userId);
 }
Esempio n. 4
0
 /**
  * Mark a notification as read
  *
  * @param userId The user's ID
  * @return The user's notifications
  */
 public Response markNotificationAsRead(long userId, @SessionToken String sessionToken) {
   checkId(userId);
   return mUserInterface.markNotificationAsRead(userId, sessionToken);
 }
Esempio n. 5
0
 /**
  * Get users registered on Crowdmap
  *
  * @return Users detail
  */
 public Users getUsers() {
   return mUserInterface.getUsers();
 }
Esempio n. 6
0
 /**
  * The map a user is associated with.
  *
  * @param userId The user's ID
  * @return The maps by the user.
  */
 public Maps getUsersAssociatedMaps(long userId) {
   checkId(userId);
   return mUserInterface.getUsersAssociatedMaps(userId);
 }
Esempio n. 7
0
 /**
  * Get users notifications
  *
  * @param userId The user's ID to be used for fetching the notification details
  * @return The list of notifications
  */
 public Notifications getNotifications(long userId) {
   checkId(userId);
   return mUserInterface.getNotifications(userId);
 }
Esempio n. 8
0
 /**
  * Get the map the user follows
  *
  * @param userId The user's ID
  * @return The map the user follows
  */
 public Maps getUserFollowedMap(long userId) {
   checkId(userId);
   return mUserInterface.getUserFollowedMap(userId);
 }
Esempio n. 9
0
 /**
  * Get the map a user collaborates on.
  *
  * @param userId The user's ID
  * @return The maps the user collaborates on.
  */
 public Maps getMapsUserCollaboratesOn(long userId) {
   checkId(userId);
   return mUserInterface.getMapsUserCollaboratesOn(userId);
 }
Esempio n. 10
0
 /**
  * Stop following a user
  *
  * @param userId The user's ID
  * @return The users the user follows without including the user the user stopped following.
  */
 public Users stopFollowingUser(long userId, @SessionToken String sessionToken) {
   checkId(userId);
   return mUserInterface.stopFollowingUser(userId, sessionToken);
 }
Esempio n. 11
0
 /**
  * Verify that a user follows the provided user ID
  *
  * @return The Users
  */
 public Users verifyUsersFollowing(long userId, long followerId) {
   checkId(userId);
   return mUserInterface.verifyUsersFollowing(userId, followerId);
 }
Esempio n. 12
0
 /**
  * Get Users followed by a particular users
  *
  * @param userId The user ID of the user to get his/her followers.
  * @return The users
  */
 public Users getUsersFollowedBy(long userId) {
   return mUserInterface.getUsersFollowedBy(userId);
 }
Esempio n. 13
0
 /**
  * Delete a user's avatar
  *
  * @param userId The user's ID
  * @return The user.
  */
 public Users deleteUserAvatar(long userId, @SessionToken String sessionToken) {
   checkId(userId);
   return mUserInterface.deleteUserAvatar(userId, sessionToken);
 }
Esempio n. 14
0
 /**
  * Update user avatar
  *
  * @param userId The user's ID
  * @return The updated user
  */
 public Users updateUserAvatar(long userId, String avatar, @SessionToken String sessionToken) {
   checkId(userId);
   return mUserInterface.updateAvatar(userId, avatar, sessionToken);
 }