module Potato module DAmn # Parser for dAmn packets. class Packet # Matches packets that should contain a body. BODIED = [ /^recv p?chat:(.*?)\n\nmsg main/, /^recv p?chat:(.*?)\n\naction main/, /^property p?chat:(.*?)\np=(topic|title|privclasses)/, /^recv p?chat:(.*?)\n\nkicked/, /^recv p?chat:(.*?)\n\nadmin show/, /^recv p?chat:(.*?)\n\nadmin privclass/, /^kicked/ ] # All existing tablumps. TABLUMPS = (%w[&b &/b &i &/i &u &/u &s &/s &sup &/sup &sub &/sub &code &/code &br &ul &/ul &ol &/ol &li &/li &bcode &/bcode &/a &/acro &/abbr &p &/p].map{|lump| lump + "\t" } + [/&emote\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t/, /&a\t([^\t]+)\t([^\t]*)\t/, /&link\t([^\t]+)\t&\t/, /&link\t([^\t]+)\t([^\t]+)\t&\t/, /&dev\t[^\t]\t([^\t]+)\t/, /&avatar\t([^\t]+)\t[0-9]+\t/, /&thumb\t([0-9]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t/, /&img\t([^\t]+)\t([^\t]*)\t([^\t]*)\t/, /&iframe\t([^\t]+)\t([0-9%]*)\t([0-9%]*)\t&\/iframe\t/, /&acro\t([^\t]+)\t/, /&abbr\t([^\t]+)\t/, /^.+?<\/abbr>:/]). zip(["\x02", "\x0F", "\x16", "\x0F", "\x1F", "\x0F", "", "", "", "", "", "", "", "", "
", "", "
    ", "
", "
  • ", "
  • ", "", "", "", "", "", "

    ", "

    ", '\1', '', '\1', '\1 (\2)', ':dev\1:', ':icon\1:', ':thumb\1:', '\2', '