This commit is contained in:
nnduc
2026-10-24 14:03:52 +07:00
commit 4fe046de58
4790 changed files with 311146 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
var Account = {
resetPassword: function () {
var form = document.querySelector('form[name=password]');
form.reset();
document.querySelector('#password_save').className = 'button color flat';
},
resolveSessionsStates: function () {
var store = new ChatOmemoStorage();
store.getSessionsIds(store.jid).map(id => {
store.getSessionState(store.jid + '.' + id).then(state => {
if (state) {
let checkbox = document.querySelector('input[name=accountsessionstate_' + id + ']');
if (checkbox) {
checkbox.checked = true;
}
}
})
});
},
toggleFingerprintState: function (checkbox) {
var store = new ChatOmemoStorage();
store.setSessionState(checkbox.dataset.identifier, checkbox.checked);
},
deleteBundle: async function (bundleid) {
ChatOmemo.resolveContactFingerprints(USER_JID).then(remoteKeys => {
remoteKeys = remoteKeys.filter(remoteKey =>
remoteKey.bundleid == bundleid
);
Account_ajaxDeleteBundle(remoteKeys[0])
});
},
deleteBundleConfirm: function (bundleid) {
var store = new ChatOmemoStorage();
var address = new libsignal.SignalProtocolAddress(USER_JID, bundleid);
store.removeSession(address);
Account_ajaxDeleteBundleConfirm(bundleid, store.getOwnSessionsIds());
},
refreshFingerprints: async function () {
ChatOmemo.resolveContactFingerprints(USER_JID).then(remoteKeys => {
let omemoStorage = new ChatOmemoStorage;
omemoStorage.getLocalRegistrationId().then(localBundleId => {
omemoStorage.getIdentityKeyPair().then(identityKey => {
// Remove it if its already there
remoteKeys = remoteKeys.filter(remoteKey =>
remoteKey.bundleid != localBundleId.toString()
);
remoteKeys.unshift({
jid: USER_JID,
self: true,
bundleid: localBundleId.toString(),
fingerprint: MovimUtils.arrayBufferToBase64(identityKey.pubKey)
});
Account_ajaxHttpGetFingerprints(remoteKeys);
});
});
});
}
}
MovimWebsocket.attach(function () {
if (OMEMO_ENABLED) Account.refreshFingerprints();
Account_ajaxHttpGetPresences();
Account_ajaxGetGateways();
});
+19
View File
@@ -0,0 +1,19 @@
[account]
title = Account
account_management = Account management
password_change_title = Change my password
password = Password
password_confirmation = Password confirmation
password_changed = The password has been updated
password_not_same = The provided passwords are not the same
delete = Delete your account
delete_text = You will delete your XMPP account and all the relative information linked to it (profile, contacts, and publications).
delete_text_confirm = Type your full username
delete_text_error = Please provide a valid username.
gateway_title = Gateways
clear = Leave this instance
clear_text = You will delete all the relative information linked to your account on this Movim instance (profile, contacts, and publications).
clear_text_confirm = This action will not delete your account but will disconnect you from Movim.
delete_bundle_title = OMEMO Key deletion
delete_bundle_text = You are going to destroy the following OMEMO key. Your contacts will not be able to encrypt messages using that key anymore. This action cannot be reverted. Are you sure?
xmpp_server_info = XMPP Server Information