Class

userActions

userActions()

Constructor

# new userActions()

We use this module to access our user related backend API All the calls here are to the backend of the web-app

View Source frontend/siinc-tv/src/user/userActions.js, line 17

Methods

# static answerFriendRequest(fromUser, toUser, accepted)

Parameters:
Name Type Description
fromUser String id of request sender
toUser String id of request responder
accepted Boolean responder accepted or rejected

View Source frontend/siinc-tv/src/user/userActions.js, line 195

# static authenicateFacebook()

Prompts to authenticate with facebook

View Source frontend/siinc-tv/src/user/userActions.js, line 164

# static authenicateGoogle()

Prompts to authenticate with google

View Source frontend/siinc-tv/src/user/userActions.js, line 157

# static authenicateTwitch()

Prompts to authenticate with twitch

View Source frontend/siinc-tv/src/user/userActions.js, line 150

# static checkUsernameExists(regUsername)

Checks if a username exists in the databaase
Parameters:
Name Type Description
regUsername * username to check for

View Source frontend/siinc-tv/src/user/userActions.js, line 108

true if username exists false otherwise

# static clearNotifications()

Deletes all clearable notifications from current user

View Source frontend/siinc-tv/src/user/userActions.js, line 304

# static createNewUser(regUsername, regEmail, regPassword)

Tries to register a custom user with given username , email and password
Parameters:
Name Type Description
regUsername * userName to register with
regEmail * email to registerwith
regPassword * password tor register with

View Source frontend/siinc-tv/src/user/userActions.js, line 27

"auth/user_created" if succesful, otherwise the relevant error (username exists, etc..)

# static deleteNotification(id)

Removes a notification with given id from current user
Parameters:
Name Type Description
id *

View Source frontend/siinc-tv/src/user/userActions.js, line 279

# static getUser()

Returns the up-to-date data of the currently signed in user (or null if no user exist)

View Source frontend/siinc-tv/src/user/userActions.js, line 77

# static getUserData(userId)

Returns data regarding a specific requested user by username
Parameters:
Name Type Description
userId * userId of the user to search for

View Source frontend/siinc-tv/src/user/userActions.js, line 91

# static isUserOnline(userId) → {Boolean}

Parameters:
Name Type Description
userId String id of user

View Source frontend/siinc-tv/src/user/userActions.js, line 354

true if user online, otherwise false
Boolean

# static pokeYourself()

Temporary test function - sends a notification to your own user

View Source frontend/siinc-tv/src/user/userActions.js, line 292

# static searchUsers(searchString, page)

Searches user by a search string (looks at their username and various data) and what page to look in Results are paginated to pages with 20 entries each
Parameters:
Name Type Description
searchString * string to search in
page * what page of the results we are looking for

View Source frontend/siinc-tv/src/user/userActions.js, line 127

# static sendFollowRequest(fromUser, toUser)

Parameters:
Name Type Description
fromUser String id of follower
toUser String id of followed user

View Source frontend/siinc-tv/src/user/userActions.js, line 238

# static sendFriendRequest(fromUser, toUser)

Parameters:
Name Type Description
fromUser String id of request sender
toUser String id of request receiver

View Source frontend/siinc-tv/src/user/userActions.js, line 175

# static sendUnfollowRequest(fromUser, toUser)

Parameters:
Name Type Description
fromUser String id of the unfollower
toUser String id of the unfollowed

View Source frontend/siinc-tv/src/user/userActions.js, line 260

# static setRedirectURL()

Sets the redirect URI for authentication calls to be the current URI

View Source frontend/siinc-tv/src/user/userActions.js, line 139

# static signinWithUsernameAndPassword(regUsername, regPassword)

Tries to sign in a user with a given username and password
Parameters:
Name Type Description
regUsername * username
regPassword * password

View Source frontend/siinc-tv/src/user/userActions.js, line 48

if failed, a string describing the failure, otherwise the data of the user that signed in

# static signOut()

Logs the current user on the session out

View Source frontend/siinc-tv/src/user/userActions.js, line 64

# static unfriendFriendRequest(fromUser, toUser)

Parameters:
Name Type Description
fromUser * id of unfriending user
toUser * id of unfriended user

View Source frontend/siinc-tv/src/user/userActions.js, line 215

# static updateUserInterests(userId, data)

Parameters:
Name Type Description
userId String id of user
data String list of interests

View Source frontend/siinc-tv/src/user/userActions.js, line 336

# static updateUserShortDescription(userId, data)

Parameters:
Name Type Description
userId * id of user
data * new description text

View Source frontend/siinc-tv/src/user/userActions.js, line 318