diff --git a/app/definitions/IUser.ts b/app/definitions/IUser.ts index 7a82aa64e..aaf49bd28 100644 --- a/app/definitions/IUser.ts +++ b/app/definitions/IUser.ts @@ -132,7 +132,7 @@ export interface IUser extends IRocketChatRecord, Omit { user: IUserRegistered }; }; + 'users.setStatus': { + POST: (params: { status: string; message: string }) => {}; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index c838bcd8d..de888e3a6 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -265,10 +265,8 @@ export const setUserPreferences = (userId: string, data: Partial +export const setUserStatus = (status: string, message: string) => // RC 1.2.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('users.setStatus', { status, message }); export const setReaction = (emoji: string, messageId: string) => diff --git a/app/views/StatusView.tsx b/app/views/StatusView.tsx index a8822df00..2f89660be 100644 --- a/app/views/StatusView.tsx +++ b/app/views/StatusView.tsx @@ -11,7 +11,7 @@ import SafeAreaView from '../containers/SafeAreaView'; import Status from '../containers/Status/Status'; import TextInput from '../containers/TextInput'; import { LISTENER } from '../containers/Toast'; -import { IApplicationState, IBaseScreen } from '../definitions'; +import { IApplicationState, IBaseScreen, IUser } from '../definitions'; import I18n from '../i18n'; import RocketChat from '../lib/rocketchat'; import { getUserSelector } from '../selectors/login'; @@ -54,19 +54,13 @@ const styles = StyleSheet.create({ } }); -interface IUser { - id?: string; - status?: string; - statusText?: string; -} - interface IStatusViewState { statusText: string; loading: boolean; } interface IStatusViewProps extends IBaseScreen { - user: IUser; + user: Pick; isMasterDetail: boolean; Accounts_AllowInvisibleStatusOption: boolean; }