$m->connect()

edited January 2010 in Plugins

$m->connect('main/hello',
array('action' => 'hello'));

if no 'main', it will return 'no such user', why?

Comments

  • It seems to work fine for me. I think we need more information, like what HelloAction looks like.
  • oh, it is the plugin Sample
    I am wondering why need 'main' for $m->connect()
    I want to the urel htpp://domain/hello instead of htpp://domain/main/hello go to HelloAction
  • The reason main is there is because it restricts the username registration less.
    For example, on your site now you can't have a user called 'hello' because their profile will be unreachable.

    By putting things under main, you haven't placed any more restrictions on usernames.
    That's why a lot of the default actions are placed under there, like login, logout, subscribe, block, etc.
  • The other thing is that plugins register their paths after the default path for usernames, and 'hello' matches the pattern for a username.

    If you must have /hello instead of /main/hello, hook StartInitializeRouter instead, and your pattern will be first.
  • I find TwitterBridge plugin use hook onRouterInitialized instead of StartInitializeRouter, however the path 'twitter/authorization' is not under 'main', and I checked that 'twitter' could not be registered as a nickname.

    Does StatusNet have a default nickname blacklist? and where is it?

    ---------------------------TwitterBridgePlugin -------------------------------
    function onRouterInitialized($m)
    {
    $m->connect('twitter/authorization',
    array('action' => 'twitterauthorization'));
    $m->connect('settings/twitter', array('action' => 'twittersettings'));
    $m->connect('main/twitterlogin', array('action' => 'twitterlogin'));

    return true;
    }
    -------------------------------------
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID