]>
jfr.im git - irc/rizon/acid.git/blob - acid/src/main/java/net/rizon/acid/core/AcidUser.java
6b66d1a41c54f447f9ca1a627825ff53545509bb
1 package net
.rizon
.acid
.core
;
3 import net
.rizon
.acid
.plugins
.Plugin
;
5 import net
.rizon
.acid
.conf
.Client
;
7 public class AcidUser
extends User
12 public AcidUser(final String nick
, final String user
, final String host
, final String vhost
, final String name
, final String modes
)
14 super(nick
, user
, host
, vhost
, name
, AcidCore
.me
, AcidCore
.getTS(), AcidCore
.getTS(), modes
, User
.generateUID(), "255.255.255.255");
17 public AcidUser(Plugin pkg
, Client c
)
19 super(c
.nick
, c
.user
, c
.host
, c
.vhost
, c
.name
, AcidCore
.me
, AcidCore
.getTS(), AcidCore
.getTS(), c
.modes
, User
.generateUID(), "255.255.255.255");
23 if (client
!= null && client
.channels
!= null)
24 for (String ch
: client
.channels
)
25 this.joinChan(Acidictive
.conf
.getChannelNamed(ch
));
28 public void introduce()
32 if (this.getNSPass() != null && !this.getNSPass().isEmpty())
33 Protocol
.privmsg(this.getUID(), "NickServ@services.rizon.net", "IDENTIFY " + this.getNSPass()); // XXX
35 for (Channel chan
: this.getChannels())
36 Protocol
.join(this, chan
);
39 public void joinChan(final String channel
)
41 Channel chan
= Channel
.findChannel(channel
);
42 if (chan
!= null && this.isOnChan(chan
))
47 chan
= new Channel(channel
, AcidCore
.getTS());
48 chan
.setMode('n'); chan
.setMode('t');
50 if (!AcidCore
.me
.isBursting())
51 Protocol
.join(this, chan
);
52 chan
.addUser(this, "");
56 public void partChan(Channel chan
)
58 if (!this.isOnChan(chan
))
61 Protocol
.part(this, chan
.getName());
62 chan
.removeUser(this);
66 public void quit(final String reason
)
68 Protocol
.quit(this, reason
);
72 public final String
getNSPass()
80 public net
.rizon
.acid
.conf
.Command
findConfCommand(String name
, String channel
)
82 if (client
!= null && this.client
.commands
!= null)
83 for (net
.rizon
.acid
.conf
.Command c
: this.client
.commands
)
84 if (c
.name
.equalsIgnoreCase(name
) && (channel
== null || c
.allowsChannel(channel
)))
89 public List
<net
.rizon
.acid
.conf
.Command
> getConfCommands()
91 return this.client
.commands
;