mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
added talk method to IRC module.
This commit is contained in:
parent
4d26bd839c
commit
6d751661b8
2 changed files with 20 additions and 0 deletions
19
IRC.Mod
19
IRC.Mod
|
|
@ -540,6 +540,25 @@ BEGIN
|
|||
Out.String("exiting."); Out.Ln;
|
||||
END finalize;
|
||||
|
||||
PROCEDURE sendMsgToDst*(VAR inst: instance; VAR dst: ARRAY OF CHAR; msg: ARRAY OF CHAR);
|
||||
VAR
|
||||
s: POINTER TO ARRAY OF CHAR;
|
||||
i, j: LONGINT;
|
||||
b: BOOLEAN;
|
||||
BEGIN
|
||||
i := Strings.Length(msg);
|
||||
j := Strings.Length(dst);
|
||||
NEW(s, i + j + Strings.Length(msgPRIVMSG) + 6(* to fit a colon and two spaces and eol *));
|
||||
COPY(msgPRIVMSG, s^);
|
||||
Strings.Append(' ', s^);
|
||||
Strings.Append(dst, s^);
|
||||
Strings.Append(' :', s^);
|
||||
Strings.Append(msg, s^);
|
||||
sh.appendLFCR(s^);
|
||||
Out.String("sending: "); Out.String(s^); Out.Ln;
|
||||
b := Send(inst, s^);
|
||||
END sendMsgToDst;
|
||||
|
||||
PROCEDURE processFurther(VAR inst: instance; VAR line: ARRAY OF CHAR);
|
||||
VAR
|
||||
message: ARRAY msgLen OF CHAR;
|
||||
|
|
|
|||
1
test.Mod
1
test.Mod
|
|
@ -27,6 +27,7 @@ BEGIN
|
|||
Out.String("ident: '"); Out.String(ident); Out.Char("'"); Out.Ln;
|
||||
Out.String("host: '"); Out.String(host); Out.Char("'"); Out.Ln;
|
||||
Out.String("*** that's it ***"); Out.Ln;
|
||||
IRC.sendMsgToDst(inst, user, "hello, nice to meet you");
|
||||
END onPrivateMessage;
|
||||
|
||||
PROCEDURE onPublicMessage(VAR msg, msgtype, user, ident, rcpt, host: ARRAY OF CHAR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue