Commit a06d2c49 authored by JC Brand's avatar JC Brand

Implement own device removal via stanza

parent 26e93658
...@@ -8575,8 +8575,10 @@ body.reset { ...@@ -8575,8 +8575,10 @@ body.reset {
margin-top: 1em; } margin-top: 1em; }
#conversejs #converse-modals .btn { #conversejs #converse-modals .btn {
font-weight: normal; } font-weight: normal; }
#conversejs #converse-modals #user-profile-modal label { #conversejs #converse-modals #user-profile-modal .profile-form label {
font-weight: bold; } font-weight: bold; }
#conversejs #converse-modals #user-profile-modal .fingerprint-removal label {
padding: 0.75rem 1.25rem; }
#conversejs #converse-modals #user-profile-modal .list-group-item { #conversejs #converse-modals #user-profile-modal .list-group-item {
display: flex; display: flex;
justify-content: left; justify-content: left;
......
...@@ -16,9 +16,17 @@ ...@@ -16,9 +16,17 @@
} }
#user-profile-modal { #user-profile-modal {
label { .profile-form {
font-weight: bold; label {
font-weight: bold;
}
}
.fingerprint-removal {
label {
padding: 0.75rem 1.25rem;
}
} }
.list-group-item { .list-group-item {
display: flex; display: flex;
justify-content: left; justify-content: left;
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
}); });
this.messages = new _converse.Messages(); this.messages = new _converse.Messages();
this.messages.browserStorage = new Backbone.BrowserStorage[_converse.storage]( this.messages.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.messages${this.get('jid')}${_converse.bare_jid}`)); `converse.messages${this.get('jid')}${_converse.bare_jid}`);
this.messages.chatbox = this; this.messages.chatbox = this;
this.messages.on('change:upload', (message) => { this.messages.on('change:upload', (message) => {
...@@ -626,7 +626,7 @@ ...@@ -626,7 +626,7 @@
onConnected () { onConnected () {
this.browserStorage = new Backbone.BrowserStorage.session( this.browserStorage = new Backbone.BrowserStorage.session(
b64_sha1(`converse.chatboxes-${_converse.bare_jid}`)); `converse.chatboxes-${_converse.bare_jid}`);
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({
'add': true, 'add': true,
......
This diff is collapsed.
...@@ -68,37 +68,47 @@ ...@@ -68,37 +68,47 @@
<form class="converse-form fingerprint-removal"> <form class="converse-form fingerprint-removal">
<ul class="list-group fingerprints"> <ul class="list-group fingerprints">
<li class="list-group-item active">{{{o.__("This device's OMEMO fingerprint")}}}</li> <li class="list-group-item active">{{{o.__("This device's OMEMO fingerprint")}}}</li>
<li class="fingerprint-removal-item list-group-item"> <li class="list-group-item">
{[ if (o.view.current_device.get('bundle') && o.view.current_device.get('bundle').fingerprint) { ]} {[ if (o.view.current_device.get('bundle') && o.view.current_device.get('bundle').fingerprint) { ]}
<input type="checkbox" value="{{{o.view.current_device.get('id')}}}"
aria-label="{{{o.__('Checkbox for removing the following fingerprint')}}}">
<span class="fingerprint">{{{o.view.current_device.get('bundle').fingerprint}}}</span> <span class="fingerprint">{{{o.view.current_device.get('bundle').fingerprint}}}</span>
{[ } else {]} {[ } else {]}
<span class="spinner fa fa-spinner centered"/> <span class="spinner fa fa-spinner centered"/>
{[ } ]} {[ } ]}
</li> </li>
</ul> </ul>
{[ if (o.view.other_devices) { ]} {[ if (o.view.other_devices.length) { ]}
<ul class="list-group fingerprints"> <ul class="list-group fingerprints">
<li class="list-group-item active"> <li class="list-group-item nopadding active">
<label>
<input type="checkbox" class="select-all" title="{{{o.__('Select all')}}}" <input type="checkbox" class="select-all" title="{{{o.__('Select all')}}}"
aria-label="{{{o.__('Checkbox to select fingerprints of all other OMEMO devices')}}}"> aria-label="{{{o.__('Checkbox to select fingerprints of all other OMEMO devices')}}}">
{{{o.__('Other OMEMO-enabled devices')}}} {{{o.__('Other OMEMO-enabled devices')}}}
</label>
</li> </li>
{[ o._.forEach(o.view.other_devices, function (device) { ]} {[ o._.forEach(o.view.other_devices, function (device) { ]}
{[ if (device.get('bundle') && device.get('bundle').fingerprint) { ]} {[ if (device.get('bundle') && device.get('bundle').fingerprint) { ]}
<li class="fingerprint-removal-item list-group-item"> <li class="fingerprint-removal-item list-group-item nopadding">
<label>
<input type="checkbox" value="{{{device.get('id')}}}" <input type="checkbox" value="{{{device.get('id')}}}"
aria-label="{{{o.__('Checkbox for selecting the following fingerprint')}}}"> aria-label="{{{o.__('Checkbox for selecting the following fingerprint')}}}">
<span class="fingerprint">{{{device.get('bundle').fingerprint}}}</span> <span class="fingerprint">{{{device.get('bundle').fingerprint}}}</span>
</label>
</li>
{[ } else {]}
<li class="fingerprint-removal-item list-group-item nopadding">
<label>
<input type="checkbox" value="{{{device.get('id')}}}"
aria-label="{{{o.__('Checkbox for selecting the following fingerprint')}}}">
<span>{{{o.__('Device without a fingerprint')}}}</span>
</label>
</li> </li>
{[ } ]} {[ } ]}
{[ }); ]} {[ }); ]}
</ul> </ul>
<div class="form-group">
<button type="submit" class="save-form btn btn-primary">{{{o.__('Remove checked devices and close')}}}</button>
</div>
{[ } ]} {[ } ]}
<div class="form-group">
<button type="submit" class="save-form btn btn-primary">{{{o.__('Remove checked devices and close')}}}</button>
</div>
</form> </form>
</div> </div>
{[ } ]} {[ } ]}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment