#============================================================= -*-perl-*-
#
# Bot::Jabbot::Hints
#
# DESCRIPTION
#
# Some hints for Jabbot
#
# AUTHOR
#   Epifanov Ivan  <isage@aumi.ru>
#
# COPYRIGHT
#
#   This module copyright (c) 2009 Ivan Epifanov.
#   All rights reserved. This module is free software; you can redistribute it
#   and/or modify it under the terms of the Perl Artistic License.
#   (see http://www.perl.com/perl/misc/Artistic.html)
#
#========================================================================

=head1 NAME

Bot::Jabbot::Hints - Jabbot Hints

=head1 Jabbot Hints

This documentation provides some hints and code snippets for you to use in your modules

=head2 Kick user (in muc)
use this code in muc message handler to kick user:

    my $user='someuser@jabber.org';
    $msg->room()->connection()->send_iq('set',
                                                {
                                                    defns => 'http://jabber.org/protocol/muc#admin',
                                                    node => {
                                                        name => 'query',
                                                        ns=>'http://jabber.org/protocol/muc#admin',
                                                        childs=>[
                                                            {
                                                                name => 'item',
                                                                attrs=>['role','none','nick',$user]
                                                            }
                                                        ]
                                                    }
                                                }, undef,to => $msg->room()->jid()
            );

You can also use this code to manipulate user roles

=head2 Ban user (in muc)
use this code in muc message handler to ban user:

    my $user='someuser@jabber.org';
    $msg->room()->connection()->send_iq('set',
                                                {
                                                    defns => 'http://jabber.org/protocol/muc#admin',
                                                    node => {
                                                        name => 'query',
                                                        ns=>'http://jabber.org/protocol/muc#admin',
                                                        childs=>[
                                                            {
                                                                name => 'item',
                                                                attrs=>['affiliation','outcast','jid',$user]
                                                            }
                                                        ]
                                                    }
                                                }, undef,to => $msg->room()->jid()
            );

You can also use this code to manipulate user affilations

=cut

# Local Variables:
# mode: perl
# perl-indent-level: 4
# indent-tabs-mode: nil
# End:
#
# vim: expandtab shiftwidth=4: