FlexHub Forum

CLCK - Clickable commands in mainchat/pm

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
CLCK - Clickable commands in mainchat/pm
« 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 (clicking will open a popup to set a number)
- minshare: 0  (clicking will open a popup to set a number, rightclicking could show some predefined settings to choose from)
- allowpassive: false (clicking will set it to true, rightclicking will show the two options)
- redirectmode: 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.


« Last Edit: October 21, 2011, 15:38:49 by FlipFlop™ »
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: Clickable commands in mainchat/pm
« Reply #1 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


« Last Edit: October 22, 2011, 21:12:37 by FlipFlop™ »
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: CLCK - Clickable commands in mainchat/pm
« Reply #2 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.
« Last Edit: October 24, 2011, 01:36:13 by FlipFlop™ »
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Re: CLCK - Clickable commands in mainchat/pm
« Reply #3 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?

Offline FlipFlop™

  • FlexHub Developer
  • *****
  • 505
Re: CLCK - Clickable commands in mainchat/pm
« Reply #4 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.
Check the new FlexHubList!           Add awesome statistics like this for your hub!

This post is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.