5f38a914b1
- No need for it to be in a separate plugin - Make all UI strings translateable - Remove the "Are you sure?" prompt - Add tests Fixes #326
29 lines
757 B
JavaScript
29 lines
757 B
JavaScript
import { __ } from 'i18n';
|
|
import { api, converse, _converse } from '@converse/headless/core';
|
|
|
|
const { Strophe, $iq, sizzle, u } = converse.env;
|
|
|
|
export function getPrettyStatus (stat) {
|
|
if (stat === 'chat') {
|
|
return __('online');
|
|
} else if (stat === 'dnd') {
|
|
return __('busy');
|
|
} else if (stat === 'xa') {
|
|
return __('away for long');
|
|
} else if (stat === 'away') {
|
|
return __('away');
|
|
} else if (stat === 'offline') {
|
|
return __('offline');
|
|
} else {
|
|
return __(stat) || __('online');
|
|
}
|
|
}
|
|
|
|
export async function logOut (ev) {
|
|
ev?.preventDefault();
|
|
const result = await api.confirm(__("Are you sure you want to log out?"));
|
|
if (result) {
|
|
api.user.logout();
|
|
}
|
|
}
|