Skip to content

Commit

Permalink
API commands scopes, changes for API semantics (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
alwx committed Oct 10, 2017
1 parent 49429c1 commit d7b7862
Show file tree
Hide file tree
Showing 47 changed files with 1,691 additions and 617 deletions.
4 changes: 2 additions & 2 deletions env/dev/env/ios/main.cljs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns ^:figwheel-no-load env.ios.main
(ns ^:figwheel-no-load env.ios.main
(:require [reagent.core :as r]
[re-frisk-remote.core :as rr]
[status-im.ios.core :as core]
Expand All @@ -12,7 +12,7 @@
(def root-el (r/as-element [reloader]))

(figwheel/watch-and-reload
:websocket-url "ws://10.0.1.15:3449/figwheel-ws"
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc))

Expand Down
27 changes: 24 additions & 3 deletions resources/default_contacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"unremovable?": true
},

"wallet":
{
"name":
Expand All @@ -36,12 +37,10 @@
"add-chat?": true,
"dapp?": true,
"groups": ["dapps"],
"has-global-command?": true,
"dapp-url":
{
"en": "https://status.im/dapps/wallet/"
},
"bot-url": "local://wallet-bot",
"unremovable?": true
},

Expand All @@ -53,10 +52,32 @@
"ru": "Печкин"
},
"dapp?": true,
"has-global-command?": true,
"mixable?": true,
"bot-url": "local://mailman-bot"
},

"transactor-group":
{
"name":
{
"en": "Transactor"
},
"dapp?": true,
"mixable?": true,
"bot-url": "local://transactor-group-bot"
},

"transactor-personal":
{
"name":
{
"en": "Transactor"
},
"dapp?": true,
"mixable?": true,
"bot-url": "local://transactor-personal-bot"
},

"demo-bot":
{
"name":
Expand Down
4 changes: 2 additions & 2 deletions resources/js/bots/browse/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function browse(params, context) {
}

status.command({
name: "global",
name: "browse",
title: I18n.t('browse_title'),
registeredOnly: true,
scope: ["global", "registered-only", "group-chats", "personal-chats", "can-use-for-dapps"],
description: I18n.t('browse_description'),
color: "#ffa500",
fullscreen: true,
Expand Down
18 changes: 2 additions & 16 deletions resources/js/bots/console/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ function phoneSuggestions(params, context) {

var phoneConfig = {
name: "phone",
registeredOnly: true,
icon: "phone_white",
color: "#5bb2a2",
title: I18n.t('phone_title'),
Expand Down Expand Up @@ -491,7 +490,6 @@ var phoneConfig = {
}
};
status.response(phoneConfig);
status.command(phoneConfig);

var faucets = [
/*{
Expand Down Expand Up @@ -540,7 +538,7 @@ status.command({
title: I18n.t('faucet_title'),
description: I18n.t('faucet_description'),
color: "#7099e6",
registeredOnly: true,
scope: ["registered-only", "group-chats", "personal-chats", "can-use-for-dapps"],
params: [{
name: "url",
type: status.types.TEXT,
Expand Down Expand Up @@ -611,7 +609,7 @@ status.command({
title: I18n.t('debug_mode_title'),
description: I18n.t('debug_mode_description'),
color: "#7099e6",
registeredOnly: true,
scope: ["registered-only", "group-chats", "personal-chats", "can-use-for-dapps"],
params: [{
name: "mode",
suggestions: debugSuggestions,
Expand All @@ -635,18 +633,6 @@ status.command({
}
});


// status.command({
// name: "help",
// title: "Help",
// description: "Request help from Console",
// color: "#7099e6",
// params: [{
// name: "query",
// type: status.types.TEXT
// }]
// });

status.response({
name: "confirmation-code",
color: "#7099e6",
Expand Down
1 change: 1 addition & 0 deletions resources/js/bots/mailman/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function locationsSuggestions (params) {
status.command({
name: "location",
title: I18n.t('location_title'),
scope: ["registered-only", "group-chats", "personal-chats"],
description: I18n.t('location_description'),
sequentialParams: true,
hideSendButton: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ function validateSend(params, context) {
params["bot-db"] = {};
}

if (!params["bot-db"]["public"] || !params["bot-db"]["public"]["recipient"] || !params["bot-db"]["public"]["recipient"]["address"]) {
if (!params["bot-db"]["public"]
|| !params["bot-db"]["public"]["recipient"]
|| !params["bot-db"]["public"]["recipient"]["address"]) {
return {
markup: status.components.validationMessage(
"Wrong address",
Expand Down Expand Up @@ -525,6 +527,7 @@ function shortPreviewSend(params, context) {

var send = {
name: "send",
scope: ["group-chats"],
icon: "money_white",
color: "#5fc48d",
title: I18n.t('send_title'),
Expand Down Expand Up @@ -559,6 +562,7 @@ var paramsRequest = [

status.command({
name: "request",
scope: ["group-chats"],
color: "#5fc48d",
title: I18n.t('request_title'),
description: I18n.t('request_description'),
Expand Down
File renamed without changes.
Loading

0 comments on commit d7b7862

Please sign in to comment.