Add special option xhr_custom_status.
Allows for sending the custom status to the server via ajax.
This commit is contained in:
parent
fd47d5ecb6
commit
fd187533fd
@ -53,6 +53,7 @@
|
|||||||
this.prebind = false;
|
this.prebind = false;
|
||||||
this.show_controlbox_by_default = false;
|
this.show_controlbox_by_default = false;
|
||||||
this.xhr_user_search = false;
|
this.xhr_user_search = false;
|
||||||
|
this.xhr_custom_status = false;
|
||||||
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
|
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
|
||||||
this.callback = callback || function () {};
|
this.callback = callback || function () {};
|
||||||
|
|
||||||
@ -70,6 +71,7 @@
|
|||||||
'prebind',
|
'prebind',
|
||||||
'show_controlbox_by_default',
|
'show_controlbox_by_default',
|
||||||
'xhr_user_search',
|
'xhr_user_search',
|
||||||
|
'xhr_custom_status',
|
||||||
'connection',
|
'connection',
|
||||||
'testing',
|
'testing',
|
||||||
'jid',
|
'jid',
|
||||||
@ -2363,6 +2365,13 @@
|
|||||||
setStatusMessage: function (status_message) {
|
setStatusMessage: function (status_message) {
|
||||||
converse.connection.send($pres().c('show').t(this.get('status')).up().c('status').t(status_message));
|
converse.connection.send($pres().c('show').t(this.get('status')).up().c('status').t(status_message));
|
||||||
this.save({'status_message': status_message});
|
this.save({'status_message': status_message});
|
||||||
|
if (this.xhr_custom_status) {
|
||||||
|
$.ajax({
|
||||||
|
url: 'set-custom-status',
|
||||||
|
type: 'POST',
|
||||||
|
data: {'msg': status_message}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user