ThreatNet::IRC::Envelope - IRC envelope for ThreatNet::Message objects


  # Handle messages as provided from an IRC channel
  sub handle_message {
        my $envelope = shift;
        # Only trust messages from our network
        return unless $envelope->who =~ /\$/;
        # Filter out anything local
        my $message = $envelope->message;
        return unless $LocalFilter->keep($message);


ThreatNet::Message objects can be created and moved around from and to a variety of places. However, when freshly recieved from an IRC channel, you may wish to apply logic to them based on special IRC-specific considerations.

The ThreatNet::IRC::Envelope class provides special "envelope" objects containing the actual message objects. The channel listener is able to apply specific logic to these envelopes, before the message itself is extracted and moves further into a system.

The primary use for these envelopes is to allow for applying trust rules on a sub-channel level. For example, trusting messages that come from a specific bot in a channel when the channel as a whole is untrusted.


new $Message, $who, $where

The new constructor creates a new IRC envelope for a particular message. It is most likely to happen inside the IRC/ThreatNet connector code, rather than in your own code.

Takes as argument a ThreatNet::Message object, the identifier of the source node, and then channel name in which the message occured.

Returns a new ThreatNet::IRC::Envelope object, or undef on error.


The message accessor returns the contents of the envelope, a ThreatNet::Message (or sub-class) object.


The who accessor returns the identification string of the source IRC client.


The where accessor returns the name of the channel that the message occured in.


All bugs should be filed via the bug tracker at

For other issues, or commercial enhancement and support, contact the author


Adam Kennedy <>



Copyright (c) 2005 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.