Recover the nick in index.html.tmpl

29 views
Skip to first unread message

sik...@gmail.com

unread,
Aug 21, 2015, 1:42:44 AM8/21/15
to kiwiirc
Hello,

I need to recover the nick of the visitor to display it somewhere in index.html.tmpl, is it possible ?

I'm very novice so if someone could to help me :)

thank you

prawnsalad

unread,
Aug 21, 2015, 6:46:24 AM8/21/15
to kiwiirc, sik...@gmail.com
Hello,

This is possible in a kiwi plugin: https://kiwiirc.com/docs/scripting/client_plugins
The network object will let you interact with the current active network: https://kiwiirc.com/docs/scripting/network

You would get the users nick in a plugin with something similar to..
    var net = kiwi.components.Network();
    var nick = net.get('nick');

From there you can place the nick wherever you need.

Darren

sik...@gmail.com

unread,
Aug 21, 2015, 12:15:50 PM8/21/15
to kiwiirc, sik...@gmail.com
Thank you, I will try :)

Last thing about the plugin in plugins examples

When clicking on a nickname in a message, insert the nickname into the control box (message input box)

var events = kiwi.components.Events();
var control = kiwi.components.ControlInput();

events.on('nick:select', function(event, data) {
event.preventDefault();

if (data.source !== 'message') {
return;
}

control.input.val(function(idx, val){
return val + data.member.get('nick') + ': ';
});
});

Do you know why it doesn't work ? I tried some things but... :(

Reply all
Reply to author
Forward
0 new messages