Browse Source

Supported bot modal actions

master
Igor Zhukov 10 years ago
parent
commit
f16ce54ae5
  1. 7
      app/js/controllers.js
  2. 2
      app/js/locales/en-us.json
  3. 8
      app/partials/desktop/user_modal.html

7
app/js/controllers.js

@ -2593,6 +2593,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -2593,6 +2593,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
});
};
$scope.sendCommand = function (command) {
AppMessagesManager.sendText($scope.userID, '/' + command);
$rootScope.$broadcast('history_focus', {
peerString: peerString
});
};
$scope.toggleBlock = function (block) {
MtpApiManager.invokeApi(block ? 'contacts.block' : 'contacts.unblock', {
id: AppUsersManager.getUserInput($scope.userID)

2
app/js/locales/en-us.json

@ -119,6 +119,8 @@ @@ -119,6 +119,8 @@
"user_modal_info": "Info",
"user_modal_phone": "Phone",
"user_modal_about": "About",
"user_modal_bot_settings": "Settings",
"user_modal_bot_help": "Help",
"user_modal_username": "Username",
"user_modal_settings": "Settings",
"user_modal_notifications": "Notifications",

8
app/partials/desktop/user_modal.html

@ -73,6 +73,14 @@ @@ -73,6 +73,14 @@
<a class="md_modal_section_link" ng-click="inviteToGroup()" my-i18n="user_modal_add_to_group"></a>
</div>
<div class="md_modal_section_link_wrap" ng-if="bot_info.commands.settings != null">
<a class="md_modal_section_link" ng-click="sendCommand('settings')" my-i18n="user_modal_bot_settings"></a>
</div>
<div class="md_modal_section_link_wrap" ng-if="bot_info.commands.help != null">
<a class="md_modal_section_link" ng-click="sendCommand('help')" my-i18n="user_modal_bot_help"></a>
</div>
<div class="md_modal_section_link_wrap" ng-if="user.phone.length > 0 &amp;&amp; !user.pFlags.contact &amp;&amp; !user.pFlags.self">
<a class="md_modal_section_link" ng-click="importContact()" my-i18n="user_modal_add_contact"></a>
</div>

Loading…
Cancel
Save