mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
bot_data: Rename delete to del.
`delete` is a reserved keyword that would interfere with the migration to an ES6 module. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
b8839302c0
commit
bde31a54c7
@@ -104,7 +104,7 @@ run_test('test_basics', () => {
|
|||||||
bot = bot_data.get(43);
|
bot = bot_data.get(43);
|
||||||
assert.equal('Bot 1', bot.full_name);
|
assert.equal('Bot 1', bot.full_name);
|
||||||
assert(bot.is_active);
|
assert(bot.is_active);
|
||||||
bot_data.delete(43);
|
bot_data.del(43);
|
||||||
bot = bot_data.get(43);
|
bot = bot_data.get(43);
|
||||||
assert.equal(bot, undefined);
|
assert.equal(bot, undefined);
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -1002,7 +1002,7 @@ with_overrides(function (override) {
|
|||||||
event = event_fixtures.realm_bot__delete;
|
event = event_fixtures.realm_bot__delete;
|
||||||
global.with_stub(function (bot_stub) {
|
global.with_stub(function (bot_stub) {
|
||||||
global.with_stub(function (admin_stub) {
|
global.with_stub(function (admin_stub) {
|
||||||
override('bot_data.delete', bot_stub.f);
|
override('bot_data.del', bot_stub.f);
|
||||||
override('settings_users.update_user_data', admin_stub.f);
|
override('settings_users.update_user_data', admin_stub.f);
|
||||||
dispatch(event);
|
dispatch(event);
|
||||||
var args = bot_stub.get_args('bot_id');
|
var args = bot_stub.get_args('bot_id');
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ var bot_data = (function () {
|
|||||||
send_change_event();
|
send_change_event();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.delete = function bot_data__delete(bot_id) {
|
exports.del = function bot_data__del(bot_id) {
|
||||||
delete bots[bot_id];
|
delete bots[bot_id];
|
||||||
delete services[bot_id];
|
delete services[bot_id];
|
||||||
send_change_event();
|
send_change_event();
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||||||
event.bot.is_active = false;
|
event.bot.is_active = false;
|
||||||
settings_users.update_user_data(event.bot.user_id, event.bot);
|
settings_users.update_user_data(event.bot.user_id, event.bot);
|
||||||
} else if (event.op === 'delete') {
|
} else if (event.op === 'delete') {
|
||||||
bot_data.delete(event.bot.user_id);
|
bot_data.del(event.bot.user_id);
|
||||||
settings_users.update_user_data(event.bot.user_id, event.bot);
|
settings_users.update_user_data(event.bot.user_id, event.bot);
|
||||||
} else if (event.op === 'update') {
|
} else if (event.op === 'update') {
|
||||||
if (_.has(event.bot, 'owner_id')) {
|
if (_.has(event.bot, 'owner_id')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user