Sha256: fe66b7a106afd32efc118550822d95d3c1e87dc7f573c30bd1f78895df3a899d

Contents?: true

Size: 602 Bytes

Versions: 3

Compression:

Stored size: 602 Bytes

Contents

hook(type: :ukick) do |dat|
  dat[:plug].users[dat[:nick]] = {} unless dat[:plug].users[dat[:nick]]
  u = dat[:plug].users[dat[:nick]]
  u[:nick] = dat[:nick]
  u[:user] = dat[:user]
  u[:host] = dat[:host]

  unless dat[:plug].chans[dat[:channel]]
    dat[:plug].chans[dat[:channel]] = {}
    dat[:plug].chans[dat[:channel]][:users] = []
  end

  dat[:plug].chans[dat[:channel]][:users].delete dat[:target] if
    dat[:plug].chans[dat[:channel]][:users].include? dat[:target]

  if dat[:target] == dat[:plug].nick
    dat[:plug].chans.delete dat[:channel]
    dat[:plug].join(dat[:channel])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/core_plugin/hooks/kick.rb
protonbot-0.3.6 lib/protonbot/core_plugin/hooks/kick.rb
protonbot-0.3.5 lib/protonbot/core_plugin/hooks/kick.rb