FlexHub Forum

Protocol talk => ADC Protocol => Topic started by: FlipFlop™ on October 21, 2011, 13:13:37

Title: CLCK - Clickable commands in mainchat/pm
Post by: FlipFlop™ on October 21, 2011, 13:13:37
Suggesting an extension to provide clickable commands in mainchat/pm. It has been discussed before on ADC Portal, but since that went offline, I'll start from here.

This extension enables highlighted clickable text in mainchat or pm.
The highlighted text can offer these features:
- when clicked it activates an included UCMD, allowing to send hubcommands directly, or use a dialog for userinput
- when rightclicked it could show options to choose from, each with it's own UCMD

Example:
<client> !hubrules
<hub> The following rules are set:
- maxusers: 600 (http://600) (clicking will open a popup to set a number)
- minshare: 0 (http://0)  (clicking will open a popup to set a number, rightclicking could show some predefined settings to choose from)
- allowpassive: false (http://false) (clicking will set it to true, rightclicking will show the two options)
- redirectmode: normal (http://normal) (clicking will show a popup to type the mode, rightclicking will show the different options to choose from)

Protocol:
With a few additions the magnet URI scheme could be used, suggestions as to how that can be done best are welcome. The main idea is to send included UCMD's to determine the actions for the link.

Implementation:
For security reasons only hub-to-client traffic should be able to send these clickable commands. It's too easy to send harmless looking links that execute hubcommands otherwise.


Title: Re: Clickable commands in mainchat/pm
Post by: FlipFlop™ on October 21, 2011, 15:16:56
Two parameters could be added to the magnet URI scheme, for specification of the CMD's to be used.
According to the MAGNET URI draft overview:
  - The prefix 'x.' is reserved for application-specific new
    parameter experimentation. Any parameters not beginning 'x.'
    are only to be defined by official MAGNET specifications.

x.cl Leftclick ICMD
x.cr Rightclick ICMD, single or multiple rightclick options, multiple options for rightclicks with x.cr1 x.cr2 etc

Example:
magnet:?x.cl=ICMD+Click\shere\sto\sjoin+TTHMSG\\s!regme\s%[line:Enter\spassword]\\n


Title: Re: CLCK - Clickable commands in mainchat/pm
Post by: FlipFlop™ on October 24, 2011, 00:19:32
It's probably better to use another scheme than magnet URI. Wouldn't want a website to offer a magnet that will try to execute a hubcommand in my DC client. And the only place where the command can be used is that particular hub, so it doesn't need to be easily shareable like a magnet.

The scheme could be similar though, and it has to be stored in mainchat like a magnet is in DC clients now.
Title: Re: CLCK - Clickable commands in mainchat/pm
Post by: light-angel on October 27, 2011, 18:53:10
couldnt the hub add a number to the command or something like that so each hub will have its own commands

EG uses the hub name to make some kind of key just for that hub?
Title: Re: CLCK - Clickable commands in mainchat/pm
Post by: FlipFlop™ on October 29, 2011, 13:38:52
Each hub will only use it's own commands, since it will use mainchat to send the clickable links, similar to how a magnet is send now. The big difference being that only the hub is allowed to send these clickable links, not a user.