Anope IRC Services

Anope Support => 1.8.x/1.7.x Support (Read Only) => Topic started by: Thiago on November 02, 2011, 06:02:41 PM

Title: [Need support] Need do send fake msg
Post by: Thiago on November 02, 2011, 06:02:41 PM
I need something like that: /nickserv fakemsg nick1 nick2 message
Both nicks need to be online and so the nick1 will send the message to nick2, nick1 won't know that... only nick2 will receive the message

I made a module but in privmsg command i don't know how to do:

Code: [Select]
char *cmd = moduleGetLastBuffer();
char *fn = NULL;
char *vn = NULL;
char *msg = NULL;
fn = myStrGetToken(cmd, ' ', 0);
vn = myStrGetToken(cmd, ' ', 1);
msg = myStrGetTokenRemainder(cmd, ' ', 2);
User *u1 = finduser(fn);
User *u2 = finduser(vn);
privmsg(u1->nick, u2->nick, msg);

The u2->nick is working well... the error is in the u1->nick because when i change the u1->nick to s_NickServ the code works very well
Title: Re: [Need support] Need do send fake msg
Post by: Jobe on November 03, 2011, 08:41:16 AM
What you ask is not possible due to "direction" restrictions most IRC servers impliment. What this means is say you have 3 servers A<->B<->C, and you have user1 on server A, if server B receives a message from user1 through its link to server C, server B will reject it as it knows user1 is ONLY sends messages through it's link to server A.
Title: Re: [Need support] Need do send fake msg
Post by: Thiago on November 03, 2011, 10:23:25 AM
So.. The fakemsg isn't possible or i can do this with a ircd module?
Title: Re: [Need support] Need do send fake msg
Post by: Jobe on November 03, 2011, 10:33:42 AM
Youd need an iRCd module on EVERY IRCd you have on your network to be able to do it.
Title: Re: [Need support] Need do send fake msg
Post by: Jan Milants on November 03, 2011, 10:40:27 AM
+ you wouldn't have to just implement the command, you d have to handle all message handling in the modules yourself because you can't rely on the s2s protocol as it would reject the messages as invalid..

that said, all of this relies on your IRCd's server-to-server protocol.. I don't know if all ircd's implement the "direction" restrictions..

I dislike the very concept of this fake mesage stuff though.. smells like abuse..  :-\
Title: Re: [Need support] Need do send fake msg
Post by: Thiago on November 03, 2011, 10:52:43 AM
i think this to... but i won't use in my network, it's only for training...
i'm learning how to make some modules of anope

tks
Title: Re: [Need support] Need do send fake msg
Post by: katsklaw on November 03, 2011, 03:49:12 PM
i think this to... but i won't use in my network, it's only for training...
i'm learning how to make some modules of anope

tks

My suggestion is to learn by coding something useful that you will use and doesn't abuse users.