diff -Nru libnet-jabber-bot-perl-2.1.5/Changes libnet-jabber-bot-perl-2.1.7/Changes --- libnet-jabber-bot-perl-2.1.5/Changes 2009-08-24 15:58:16.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/Changes 2020-11-15 21:01:37.000000000 +0000 @@ -1,83 +1,109 @@ Revision history for Net-Jabber-Bot +2.1.7 2020-11-05 Todd Rinaldo +- #15 Fix _send_individual_message to not strip new lines. + +2.1.6 +- Fix examples for new moose code +- Spelling errors in documentation +- Display server error message when we think there was a disconnect event. +- Allow the user to specify the path to the CA cert bundle via the 'ssl_ca_path' parameter. +- Move jabber object creation to lazy moose +- Add ignore file to repo +- Clean up POD so new() documentation lays out correctly +- Remove DD from code. Moose has a helper sub already for this anyways +- Explicitly set priority of users - Adam Malone +- Allow the user to specify the path to the CA cert bundle via the 'ssl_ca_path' parameter - Jan Schaumann +- Don't bail if the IQ message doesn't contain a query - Jan Schaumann +- Allow user to disable server certificate validity check - eleksir +- Use Mozilla::CA for default path for ssl_ca_path - eleksir +- Fix undefined warnings due to insufficient Moose Laziness +- Misc distro file cleanup. +- Automated testing with github actions +- Remove author tests from user installs. +- Point support to github now. + 2.1.5 -resource now unique per instance of bot based on alias_hostname_pid -new dependency from core modules - Sys::Hostname -__PACKAGE__->meta->make_immutable; for performance. -Removed gtalk option. Use tls => 1, server_host => 'gmail.com' instead. -using 'componentname' in connect rather than after connection like we were hacking it in. -All non-printable characters stripped and replaced with '.' via [:printable:] regex -Added documentation on minimal connect parameters now we have quite a few optionals. +- resource now unique per instance of bot based on alias_hostname_pid +- new dependency from core modules - Sys::Hostname +- __PACKAGE__->meta->make_immutable; for performance. +- Removed gtalk option. Use tls => 1, server_host => 'gmail.com' instead. +- using 'componentname' in connect rather than after connection like we were hacking it in. +- All non-printable characters stripped and replaced with '.' via [:printable:] regex +- Added documentation on minimal connect parameters now we have quite a few optionals. 2.1.4 -_process_jabber_message was failing to parse multiline strings - fixed -Move to github - http://github.com/toddr/perl-net-jabber-bot -Tickets/Groups will stay on Google for now. -Discussed using Backend of POE::Component::Jabber which would be a more stable/supported solution but requires perl 5.10 -MooseX::Types now. -no Moose and no MooseX::Types at end of object for droppings +- _process_jabber_message was failing to parse multiline strings - fixed +- Move to github - http://github.com/toddr/perl-net-jabber-bot +- Tickets/Groups will stay on Google for now. +- Discussed using Backend of POE::Component::Jabber which would be a more stable/supported solution but requires perl 5.10 +- MooseX::Types now. +- no Moose and no MooseX::Types at end of object for droppings 2.1.3 -Tests were failing if people didn't have Config::Std installed which is only used for Author tests +- Tests were failing if people didn't have Config::Std installed which is only used for Author tests 2.1.2 -Added warning message for legacy users initializing with message_callback or background_activity. +- Added warning message for legacy users initializing with message_callback or background_activity. 2.1.1 -Add proper meta data into makefile.pl -Cleanup debug messages. Used to be able to do them inline but moose subs don't call inside a string any more. +- Add proper meta data into makefile.pl +- Cleanup debug messages. Used to be able to do them inline but moose subs don't call inside a string any more. 2.1.0 -MOOSE!!! +- MOOSE!!! 2.0.9 -New subroutines (AddUser, RmUser, GetStatus, GetRoster) to track ??? -IsConnected reports connect status now. -ReConnect now works as expected. Calls background each re-connect attempt. +- New subroutines (AddUser, RmUser, GetStatus, GetRoster) to track ??? +- IsConnected reports connect status now. +- ReConnect now works as expected. Calls background each re-connect attempt. 2.0.8 -Bot now resonds to iq requests for version info. Also added gtalk example into the manifest (forgot for 2.0.7) +- Bot now resonds to iq requests for version info. Also added gtalk example into the manifest (forgot for 2.0.7) 2.0.7 -Fix to get gtalk working, kindly provided by Yago Jesus. It's doing something really funky with setting the hostname to gmail.com. -Need to later review why we're doing this. maybe we're ignorning connect messages from the server? -Also added gtalk bot example courtesy of Yago -New subs: GetRoster, ChangeStatus +- Fix to get gtalk working, kindly provided by Yago Jesus. It's doing something really funky with setting the hostname to gmail.com. +- Need to later review why we're doing this. maybe we're ignorning connect messages from the server? +- Also added gtalk bot example courtesy of Yago +- New subs: GetRoster, ChangeStatus 2.0.6 -Test::Pod::Coverage not configured to skip tests if not avail. Corrected this. +- Test::Pod::Coverage not configured to skip tests if not avail. Corrected this. 2.0.5 -Missed a test file mentioning IO::Prompt (t/03) +- Missed a test file mentioning IO::Prompt (t/03) 2.0.4 -Removed some email addresses present. -Tidy up manifest -Referring to google project in POD now. -Inserted gtalk fixes so the module will work with them. -Funky eval issue with gtalk client commented out. We'll have to look at that later, but for now we don't need it at all +- Removed some email addresses present. +- Tidy up manifest +- Referring to google project in POD now. +- Inserted gtalk fixes so the module will work with them. +- Funky eval issue with gtalk client commented out. We'll have to look at that later, but for now we don't need it at all 2.0.3 -Creation of Mock Client to allow automation of testing without a server. -Also added Example script so someone can see how to use the module. +- Creation of Mock Client to allow automation of testing without a server. +- Also added Example script so someone can see how to use the module. 2.0.2 -Added Log::Log4Perl as dependancy. This should be in everyone's CPAN so it shouldn't be a big deal that people need to install it even though it's not necessary for people to use the module... +- Added Log::Log4Perl as dependancy. This should be in everyone's CPAN so it shouldn't be a big deal that people need to install it even though it's not necessary for people to use the module... 2.0.1 -Oops! Guess I need to make this module dependant on Net::Jabber if it's ever going to make test. +- Oops! Guess I need to make this module dependant on Net::Jabber if it's ever going to make test. 2.0.0 -Move to 3 digit version (see pause.perl.org FAQ about starting with 2 digit version and going to 3) -internal callback maker created to reduce code. - -1.2.1 Call back functions how call self funcion via anonymous subs. -Minor bug fixes and cleanup. - -1.2.0 Re-enabled config test, plus fixed some docs. Versioning changes from here out to be 3 digit. -Bot will respond to different addressings per forum (all messages, jbot:, etc.) +- Move to 3 digit version (see pause.perl.org FAQ about starting with 2 digit version and going to 3) +- internal callback maker created to reduce code. -1.1 Initial CPAN release - Basic tests built. Still more needed. Some of the limits are hard -coded. Arguably, these should be more in a child module, not the base class? +1.2.1 +- Call back functions how call self funcion via anonymous subs. +- Minor bug fixes and cleanup. + +1.2.0 +- Re-enabled config test, plus fixed some docs. Versioning changes from here out to be 3 digit. +- Bot will respond to different addressings per forum (all messages, jbot:, etc.) + +1.1 +- Initial CPAN release - Basic tests built. Still more needed. Some of the limits are hard +- coded. Arguably, these should be more in a child module, not the base class? -1.0 Initial pre-CPAN release -- Does basic stuff but no tests yet. not CPAN ready +- 1.0 Initial pre-CPAN release -- Does basic stuff but no tests yet. not CPAN ready diff -Nru libnet-jabber-bot-perl-2.1.5/debian/changelog libnet-jabber-bot-perl-2.1.7/debian/changelog --- libnet-jabber-bot-perl-2.1.5/debian/changelog 2021-01-09 14:57:43.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/changelog 2021-09-12 13:08:30.000000000 +0000 @@ -1,3 +1,42 @@ +libnet-jabber-bot-perl (2.1.7-1) unstable; urgency=medium + + [ upstream ] + * new release(s) + + [ gregor herrmann ] + * use MetaCPAN URIs (not search.cpan.org or www.cpan.org) + + [ Jonas Smedegaard ] + * update copyright info: + + add alternate GitHub source URI + + list GitHub issue tracker as preferred upstream contact + + use License-Grant and Reference fields; + add lintian overrides about Reference field + + license packaging as GPL-3+ (not GPL-2+) + + update coverage + * update watch file: + + use file format 4 + + mention gbp --uscan in usage comment + + use substitution strings + * update git-buildpackage config: avoid any .git* files + * simplify rules; stop build-depend on devscripts dh-buildinfo cdbs + * use debhelper compatibility level 13 (not 7); + build-depend on debhelper-compat (not debhelper) + * stop build-depend explicitly on perl: + not called directly during build + * relax to (build-)depend unversioned + on libmoose-perl libmoosex-types-perl: + required versions satisfied in all supported Debian releases + * enable autopkgtest + * set Rules-Requires-Root: no + * declare compliance with Debian Policy 4.6.0 + * annotate test-only build-dependencies + * use semantic newlines in long description and copyright fields + * add patch 2001 to use ca-certificates rather than Mozilla::CA; + recommend ca-certificates + + -- Jonas Smedegaard Sun, 12 Sep 2021 15:08:30 +0200 + libnet-jabber-bot-perl (2.1.5-1.1) unstable; urgency=medium * Non maintainer upload by the Reproducible Builds team. diff -Nru libnet-jabber-bot-perl-2.1.5/debian/compat libnet-jabber-bot-perl-2.1.7/debian/compat --- libnet-jabber-bot-perl-2.1.5/debian/compat 2011-02-09 01:03:08.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7 diff -Nru libnet-jabber-bot-perl-2.1.5/debian/control libnet-jabber-bot-perl-2.1.7/debian/control --- libnet-jabber-bot-perl-2.1.5/debian/control 2011-03-13 02:28:21.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/control 2021-09-12 13:07:09.000000000 +0000 @@ -1,33 +1,42 @@ Source: libnet-jabber-bot-perl Section: perl Priority: optional -Build-Depends: devscripts (>= 2.10.7~), - perl, - cdbs (>= 0.4.85~), - debhelper (>= 7.0.1), - dh-buildinfo, - liblog-log4perl-perl, - libmoose-perl (>= 0.82), - libmoosex-types-perl (>= 0.12), - libnet-jabber-perl, - libtest-nowarnings-perl +Build-Depends: + debhelper-compat (= 13), + liblog-log4perl-perl , + libmoose-perl , + libmoosex-types-perl , + libnet-jabber-perl , + libtest-nowarnings-perl , Maintainer: Debian Perl Group Uploaders: Jonas Smedegaard -Standards-Version: 3.9.1 -Vcs-Git: git://git.debian.org/git/pkg-perl/packages/libnet-jabber-bot-perl -Vcs-Browser: http://git.debian.org/?p=pkg-perl/packages/libnet-jabber-bot-perl.git -Homepage: http://search.cpan.org/dist/Net-Jabber-Bot/ +Standards-Version: 4.6.0 +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libnet-jabber-bot-perl.git +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libnet-jabber-bot-perl +Homepage: https://metacpan.org/release/Net-Jabber-Bot +Testsuite: autopkgtest-pkg-perl +Rules-Requires-Root: no Package: libnet-jabber-bot-perl Architecture: all -Depends: ${perl:Depends}, ${misc:Depends}, ${cdbs:Depends} -Recommends: ${cdbs:Recommends} +Depends: + liblog-log4perl-perl, + libmoose-perl, + libmoosex-types-perl, + libnet-jabber-perl, + ${misc:Depends}, + ${perl:Depends}, +Recommends: + ca-certificates, Description: automated Bot creation with safeties - This Perl module, Net::Jabber::Bot, provides tools for writing a Jabber - Bot. + This Perl module, Net::Jabber::Bot, provides tools + for writing a Jabber Bot. . - The idea behind the module is that someone creating a bot should not - really have to know a whole lot about how the Jabber protocol works in - order to use it. It also allows us to abstract away all the things - that can get a bot maker into trouble. Essentially the object helps - protect the coders from their own mistakes. + The idea behind the module is + that someone creating a bot should not really have to know + a whole lot about how the Jabber protocol works in + order to use it. + It also allows us to abstract away all the things + that can get a bot maker into trouble. + Essentially the object helps protect the coders + from their own mistakes. diff -Nru libnet-jabber-bot-perl-2.1.5/debian/control.in libnet-jabber-bot-perl-2.1.7/debian/control.in --- libnet-jabber-bot-perl-2.1.5/debian/control.in 2011-03-13 02:20:58.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/control.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Source: libnet-jabber-bot-perl -Section: perl -Priority: optional -Build-Depends: @cdbs@ -Maintainer: Debian Perl Group -Uploaders: Jonas Smedegaard -Standards-Version: 3.9.1 -Vcs-Git: git://git.debian.org/git/pkg-perl/packages/libnet-jabber-bot-perl -Vcs-Browser: http://git.debian.org/?p=pkg-perl/packages/libnet-jabber-bot-perl.git -Homepage: http://search.cpan.org/dist/Net-Jabber-Bot/ - -Package: libnet-jabber-bot-perl -Architecture: all -Depends: ${perl:Depends}, ${misc:Depends}, ${cdbs:Depends} -Recommends: ${cdbs:Recommends} -Description: automated Bot creation with safeties - This Perl module, Net::Jabber::Bot, provides tools for writing a Jabber - Bot. - . - The idea behind the module is that someone creating a bot should not - really have to know a whole lot about how the Jabber protocol works in - order to use it. It also allows us to abstract away all the things - that can get a bot maker into trouble. Essentially the object helps - protect the coders from their own mistakes. diff -Nru libnet-jabber-bot-perl-2.1.5/debian/copyright libnet-jabber-bot-perl-2.1.7/debian/copyright --- libnet-jabber-bot-perl-2.1.5/debian/copyright 2011-03-13 02:27:26.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/copyright 2021-09-12 12:52:15.000000000 +0000 @@ -1,44 +1,38 @@ -Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?rev=173 +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Net::Jabber::Bot -Upstream-Contact: http://code.google.com/p/perl-net-jabber-bot/issues/entry -Source: http://search.cpan.org/dist/Net-Jabber-Bot/ +Upstream-Contact: https://github.com/toddr/perl-net-jabber-bot/issues +Source: https://metacpan.org/release/Net-Jabber-Bot + https://github.com/toddr/perl-net-jabber-bot Files: * -Copyright: 2007, Todd E Rinaldo -License: Artistic or GPL-1+ - This program is free software; you can redistribute it and/or modify it +Copyright: + 2007 Todd E Rinaldo +License-Grant: + This program is free software; + you can redistribute it and/or modify it under the same terms as Perl itself. +License: Artistic or GPL-1+ Comment: - Perl is licensed under either the Artistic license or the GNU General - Public License, version 1 or later. + Perl is licensed under either the Artistic license + or the GNU General Public License, version 1 or later. Files: ./debian/* -Copyright: 2011, Jonas Smedegaard -License: GPL-2+ +Copyright: + 2011, 2013, 2021 Jonas Smedegaard +License-Grant: + This program is free software; + you can redistribute it and/or modify it + under the terms of the GNU General Public License + as published by the Free Software Foundation; + either version 3, or (at your option) any later version. +License: GPL-3+ +Reference: debian/copyright License: Artistic -Comment: - On Debian systems the Artistic License is located in - '/usr/share/common-licenses/Artistic'. +Reference: /usr/share/common-licenses/Artistic License: GPL-1+ -Comment: - On Debian systems the GNU General Public License (GPL) version 1 is - located in '/usr/share/common-licenses/GPL-1'. +Reference: /usr/share/common-licenses/GPL-1 -License: GPL-2+ - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. -Comment: - On Debian GNU systems the GNU General Public License (GPL) version 2 is - located in '/usr/share/common-licenses/GPL-2'. - . - You should have received a copy of the GNU General Public License along - with this program. If not, see . +License: GPL-3+ +Reference: /usr/share/common-licenses/GPL-2 diff -Nru libnet-jabber-bot-perl-2.1.5/debian/copyright-check libnet-jabber-bot-perl-2.1.7/debian/copyright-check --- libnet-jabber-bot-perl-2.1.5/debian/copyright-check 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/copyright-check 2021-08-31 14:09:37.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +licensecheck --check '.*' --recursive --copyright --deb-machine --ignore '^(debian/(changelog|copyright(_hints)?))$' --lines 0 -- * > debian/copyright_hints diff -Nru libnet-jabber-bot-perl-2.1.5/debian/copyright_hints libnet-jabber-bot-perl-2.1.7/debian/copyright_hints --- libnet-jabber-bot-perl-2.1.5/debian/copyright_hints 2011-03-13 01:58:34.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/copyright_hints 2021-09-12 13:08:30.000000000 +0000 @@ -1,19 +1,24 @@ -Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?rev=166 +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: FIXME Upstream-Contact: FIXME Source: FIXME -Disclaimer: Autogenerated by CDBS +Disclaimer: Autogenerated by licensecheck Files: Changes MANIFEST + MANIFEST.SKIP + META.json META.yml Makefile.PL - debian/compat debian/control - debian/control.in + debian/copyright-check + debian/examples debian/gbp.conf + debian/patches/2001_cert.patch + debian/patches/README + debian/patches/series + debian/rules debian/source/format - debian/source/local-options debian/watch examples/bot_example.pl examples/gtalk_RSSbot.pl @@ -25,23 +30,23 @@ t/99-pod.t t/lib/MockJabberClient.pm t/test_config.sample -Copyright: *No copyright* +Copyright: NONE License: UNKNOWN FIXME -Files: debian/rules -Copyright: 2011, Jonas Smedegaard -License: GPL - FIXME - -Files: lib/Net/Jabber/Bot.pm -Copyright: & LICENSE - 2007, Todd E Rinaldo -License: Perl +Files: README.md + lib/Net/Jabber/Bot.pm +Copyright: 2007, Todd E Rinaldo +License: UNKNOWN FIXME -Files: README -Copyright: 2007, Todd E Rinaldo -License: Perl +Files: debian/source/lintian-overrides +Copyright: debian/copyright Artistic + debian/copyright GPL-1+ + debian/copyright GPL-3+ + debian/copyright artistic + debian/copyright gpl-1+ + debian/copyright gpl-3+ +License: UNKNOWN FIXME diff -Nru libnet-jabber-bot-perl-2.1.5/debian/examples libnet-jabber-bot-perl-2.1.7/debian/examples --- libnet-jabber-bot-perl-2.1.5/debian/examples 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/examples 2021-09-11 08:35:29.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru libnet-jabber-bot-perl-2.1.5/debian/gbp.conf libnet-jabber-bot-perl-2.1.7/debian/gbp.conf --- libnet-jabber-bot-perl-2.1.5/debian/gbp.conf 2010-05-14 14:58:56.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/gbp.conf 2021-09-12 12:36:17.000000000 +0000 @@ -3,3 +3,4 @@ [DEFAULT] pristine-tar = True sign-tags = True +filter = */.git* diff -Nru libnet-jabber-bot-perl-2.1.5/debian/patches/2001_cert.patch libnet-jabber-bot-perl-2.1.7/debian/patches/2001_cert.patch --- libnet-jabber-bot-perl-2.1.5/debian/patches/2001_cert.patch 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/patches/2001_cert.patch 2021-09-12 13:06:13.000000000 +0000 @@ -0,0 +1,24 @@ +Description: use ca-certificates rather than Mozilla::CA +Origin: vendor +Forwarded: not-needed +Author: Jonas Smedegaard +Last-Update: 2021-09-12 +--- a/lib/Net/Jabber/Bot.pm ++++ b/lib/Net/Jabber/Bot.pm +@@ -11,7 +11,6 @@ + use Time::HiRes; + use Sys::Hostname; + use Log::Log4perl qw(:easy); +-use Mozilla::CA; + + coerce Bool, from Str, + via { ( $_ =~ m/(^on$)|(^true$)/i ) + 0 }; # True if it's on or true. Otherwise false. +@@ -37,7 +36,7 @@ + has 'server' => ( isa => Str, is => 'rw' ); + has 'port' => ( isa => PosInt, is => 'rw', default => 5222 ); + has 'tls' => ( isa => Bool, is => 'rw', default => '0' ); +-has 'ssl_ca_path' => ( isa => Str, is => 'rw', default => Mozilla::CA::SSL_ca_file() ); ++has 'ssl_ca_path' => ( isa => Str, is => 'rw', default => '/etc/ssl/certs/ca-certificates.crt' ); + has 'ssl_verify' => ( isa => Bool, is => 'rw', default => '1' ); + has 'connection_type' => ( isa => Str, is => 'rw', default => 'tcpip' ); + has 'conference_server' => ( isa => Str, is => 'rw' ); diff -Nru libnet-jabber-bot-perl-2.1.5/debian/patches/README libnet-jabber-bot-perl-2.1.7/debian/patches/README --- libnet-jabber-bot-perl-2.1.5/debian/patches/README 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/patches/README 2021-09-11 10:19:36.000000000 +0000 @@ -0,0 +1,3 @@ +0xxx: Grabbed from upstream development. +1xxx: Possibly relevant for upstream adoption. +2xxx: Only relevant for official Debian release. diff -Nru libnet-jabber-bot-perl-2.1.5/debian/patches/series libnet-jabber-bot-perl-2.1.7/debian/patches/series --- libnet-jabber-bot-perl-2.1.5/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/patches/series 2021-09-12 13:04:13.000000000 +0000 @@ -0,0 +1 @@ +2001_cert.patch diff -Nru libnet-jabber-bot-perl-2.1.5/debian/rules libnet-jabber-bot-perl-2.1.7/debian/rules --- libnet-jabber-bot-perl-2.1.5/debian/rules 2011-03-13 02:17:46.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/rules 2021-09-12 12:44:20.000000000 +0000 @@ -1,37 +1,4 @@ #!/usr/bin/make -f -# -*- mode: makefile; coding: utf-8 -*- -# Copyright 2011, Jonas Smedegaard -# Description: Main Debian packaging script for Net::Jabber::Bot -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -include /usr/share/cdbs/1/rules/upstream-tarball.mk -include /usr/share/cdbs/1/rules/utils.mk -include /usr/share/cdbs/1/class/perl-makemaker.mk -include /usr/share/cdbs/1/rules/debhelper.mk - -DEB_UPSTREAM_PACKAGE = Net-Jabber-Bot -DEB_UPSTREAM_URL = http://www.cpan.org/modules/by-module/Net -#DEB_UPSTREAM_URL = http://search.cpan.org/CPAN/authors/id/T/TO/TODDR -DEB_UPSTREAM_TARBALL_MD5 = c6cc7ec700fa1b1b11214ab8d86fa5cc - -# Needed both by upstream build process and at runtime -common-depends = liblog-log4perl-perl, libmoose-perl (>= 0.82), libmoosex-types-perl (>= 0.12), libnet-jabber-perl -CDBS_BUILD_DEPENDS += , $(common-depends) -CDBS_DEPENDS = $(common-depends) - -# Needed by upstream tests -CDBS_BUILD_DEPENDS += , libtest-nowarnings-perl - -DEB_INSTALL_EXAMPLES_ALL += examples/* +%: + dh $@ diff -Nru libnet-jabber-bot-perl-2.1.5/debian/source/lintian-overrides libnet-jabber-bot-perl-2.1.7/debian/source/lintian-overrides --- libnet-jabber-bot-perl-2.1.5/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/source/lintian-overrides 2021-09-12 12:50:51.000000000 +0000 @@ -0,0 +1,7 @@ +# License is in Reference field (see bug#786450) +missing-license-paragraph-in-dep5-copyright debian/copyright artistic * +missing-license-paragraph-in-dep5-copyright debian/copyright gpl-1\+ * +missing-license-paragraph-in-dep5-copyright debian/copyright gpl-3\+ * +missing-license-text-in-dep5-copyright debian/copyright Artistic * +missing-license-text-in-dep5-copyright debian/copyright GPL-1\+ * +missing-license-text-in-dep5-copyright debian/copyright GPL-3\+ * diff -Nru libnet-jabber-bot-perl-2.1.5/debian/watch libnet-jabber-bot-perl-2.1.7/debian/watch --- libnet-jabber-bot-perl-2.1.5/debian/watch 2011-03-13 00:58:14.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/debian/watch 2021-09-12 12:35:57.000000000 +0000 @@ -1,3 +1,6 @@ -# Run the "uscan" command to check for upstream updates and more. -version=3 -http://search.cpan.org/dist/Net-Jabber-Bot/ .*/Net-Jabber-Bot-(\d.*)\.tar\.gz debian +version=4 +# check: uscan --report +# update: gbp import-orig --upstream-vcs-tag=vX.Y.Z --uscan + +https://metacpan.org/release/Net-Jabber-Bot \ +.*/Net-Jabber-Bot@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru libnet-jabber-bot-perl-2.1.5/examples/bot_example.pl libnet-jabber-bot-perl-2.1.7/examples/bot_example.pl --- libnet-jabber-bot-perl-2.1.5/examples/bot_example.pl 2009-06-22 20:59:57.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/examples/bot_example.pl 2020-01-18 05:37:51.000000000 +0000 @@ -33,15 +33,15 @@ $forums_and_responses{$forum} = \@response_array; } -my $bot = Net::Jabber::Bot->new({ +my $bot = Net::Jabber::Bot->new( server => $ARGV{'-server'} , conference_server => $ARGV{'-conference_server'} , port => $ARGV{'-port'} , username => $ARGV{'-user'} , password => $ARGV{'-pass'} , alias => $alias - , message_callback => \&new_bot_message # Called if new messages arrive. - , background_activity => \&background_checks # What the bot does outside jabber. + , message_function => \&new_bot_message # Called if new messages arrive. + , background_function => \&background_checks # What the bot does outside jabber. , loop_sleep_time => 20 # Minimum time before doing background function. , process_timeout => 5 # Time to wait for new jabber messages before timing out , forums_and_responses => \%forums_and_responses @@ -49,8 +49,8 @@ , ignore_self_messages => 1 # Usually you don't want to see your own messages , out_messages_per_second => 5 # Maximum messages allowed per second (server flood throttling) , max_message_size => 1000 # Maximum byte size of the message before we chop it into pieces - , max_messages_per_hour => 1000 # Keep the bot from going out of control with noisy messages - }); + , max_messages_per_hour => 1000 # Keep the bot from going out of control with noisy messages + ); foreach my $forum (@forums) { diff -Nru libnet-jabber-bot-perl-2.1.5/examples/gtalk_RSSbot.pl libnet-jabber-bot-perl-2.1.7/examples/gtalk_RSSbot.pl --- libnet-jabber-bot-perl-2.1.5/examples/gtalk_RSSbot.pl 2009-08-24 15:56:46.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/examples/gtalk_RSSbot.pl 2020-01-18 05:37:51.000000000 +0000 @@ -1,96 +1,89 @@ -use Net::Jabber::Bot; -use XML::Smart; -use utf8; -use strict; - -# Simple RSS bot (yjesus@security-projects.com) -# It works fine with Feedburner - - -my $url = 'http://feeds.boingboing.net/boingboing/iBag' ; - -my $username = 'your.gtalk.user'; -my $password = 'yourpassword'; - - -my ($last_title, $last_link) = checa(); - -my $bot = Net::Jabber::Bot->new({ - server => 'talk.google.com' - , gtalk => 1 - , conference_server => 'talk.google.com' - , port => 5222 - , username => $username - , password => $password - , alias => $username - , message_callback => \&new_bot_message - , background_activity => \&background_checks - , loop_sleep_time => 15 - , process_timeout => 5 - , ignore_server_messages => 0 - , ignore_self_messages => 0 - , out_messages_per_second => 40 - , max_message_size => 1000 - , max_messages_per_hour => 100 - })|| die "ooops\n" ; - - -my @users = $bot->GetRoster() ; - -$bot->Start(); - -sub new_bot_message { - my %bot_message_hash = @_; - - my $user = $bot_message_hash{reply_to} ; - my $message = lc($bot_message_hash{body}); - - - if ($message =~ m/\bhelp\b/) { - $bot->SendPersonalMessage($user, "Hi Im a RSS-BOT for Gtalk !!"); - } -} - - - -sub background_checks { - my ($title, $link) = checa(); - - return if ($last_title eq $title) - foreach my $tosend (@users) { - - my $status = $bot->GetStatus($tosend); - - if ($status != "unavailable") { - - $bot->SendPersonalMessage($tosend, "$title"); - $bot->SendPersonalMessage($tosend, "$link"); - } - - } - - $last_title=$title; # Now make the new title recieved the most recent title. -} - -sub checa { - my $XML ; - - eval { $XML = XML::Smart->new($url) }; - if ($@) { return undef } - - $XML = $XML->cut_root ; - my $title =$XML->{channel}{item}[0]{title}[0] ; - my $link =$XML->{channel}{item}[0]{link}[0] ; - - utf8::encode($title); - utf8::encode($link); - - return($title, $link) -} - - - - - - - +use Net::Jabber::Bot; +use XML::Smart; +use utf8; +use strict; + +# Simple RSS bot (yjesus@security-projects.com) +# It works fine with Feedburner + + +my $url = 'http://feeds.boingboing.net/boingboing/iBag' ; + +my $username = 'your.gtalk.user'; +my $password = 'yourpassword'; + + +my ($last_title, $last_link) = checa(); + +my $bot = Net::Jabber::Bot->new({ + server => 'talk.google.com' + , gtalk => 1 + , conference_server => 'talk.google.com' + , port => 5222 + , username => $username + , password => $password + , alias => $username + , message_function => \&new_bot_message + , background_function => \&background_checks + , loop_sleep_time => 15 + , process_timeout => 5 + , ignore_server_messages => 0 + , ignore_self_messages => 0 + , out_messages_per_second => 40 + , max_message_size => 1000 + , max_messages_per_hour => 100 + })|| die "ooops\n" ; + + +my @users = $bot->GetRoster() ; + +$bot->Start(); + +sub new_bot_message { + my %bot_message_hash = @_; + + my $user = $bot_message_hash{reply_to} ; + my $message = lc($bot_message_hash{body}); + + + if ($message =~ m/\bhelp\b/) { + $bot->SendPersonalMessage($user, "Hi Im a RSS-BOT for Gtalk !!"); + } +} + + + +sub background_checks { + my ($title, $link) = checa(); + + return if ($last_title eq $title); + foreach my $tosend (@users) { + + my $status = $bot->GetStatus($tosend); + + if ($status != "unavailable") { + + $bot->SendPersonalMessage($tosend, "$title"); + $bot->SendPersonalMessage($tosend, "$link"); + } + + } + + $last_title=$title; # Now make the new title recieved the most recent title. +} + +sub checa { + my $XML ; + + eval { $XML = XML::Smart->new($url) }; + if ($@) { return undef } + + $XML = $XML->cut_root ; + my $title =$XML->{channel}{item}[0]{title}[0] ; + my $link =$XML->{channel}{item}[0]{link}[0] ; + + utf8::encode($title); + utf8::encode($link); + + return($title, $link) +} diff -Nru libnet-jabber-bot-perl-2.1.5/lib/Net/Jabber/Bot.pm libnet-jabber-bot-perl-2.1.7/lib/Net/Jabber/Bot.pm --- libnet-jabber-bot-perl-2.1.5/lib/Net/Jabber/Bot.pm 2009-08-24 15:58:16.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/lib/Net/Jabber/Bot.pm 2020-11-15 21:03:29.000000000 +0000 @@ -1,8 +1,7 @@ package Net::Jabber::Bot; use Moose; -use MooseX::Types - -declare => [qw( JabberClientObject PosInt PosNum HundredInt )]; +use MooseX::Types -declare => [qw( JabberClientObject PosInt PosNum HundredInt )]; # import builtin types use MooseX::Types::Moose qw/Int HashRef Str Maybe ArrayRef Bool CodeRef Object Num/; @@ -12,64 +11,75 @@ use Time::HiRes; use Sys::Hostname; use Log::Log4perl qw(:easy); -#use Data::Dumper; #For testing only. +use Mozilla::CA; - -coerce Bool, from Str, - via {($_ =~ m/(^on$)|(^true$)/i) + 0}; # True if it's on or true. Otherwise false. +coerce Bool, from Str, + via { ( $_ =~ m/(^on$)|(^true$)/i ) + 0 }; # True if it's on or true. Otherwise false. subtype JabberClientObject, as Object, where { $_->isa('Net::Jabber::Client') }; subtype PosInt, as Int, where { $_ > 0 }; subtype PosNum, as Num, where { $_ > 0 }; -subtype HundredInt, as Num, where { $_ > 100 }; +subtype HundredInt, as Num, where { $_ > 100 }; + +has jabber_client => ( + isa => Maybe [JabberClientObject], + is => 'rw', + default => sub { Net::Jabber::Client->new } +); -has jabber_client => (isa => Maybe[JabberClientObject], - is => 'rw', - default => sub {Net::Jabber::Client->new}); #my %connection_hash : ATTR; # Keep track of connection options fed to client. -has 'client_session_id' => (isa => Str, is => 'rw'); -has 'connect_time' => (isa => PosInt, is => 'rw', default => 9_999_999_999); -has 'forum_join_grace' => (isa => PosNum, is => 'rw', default => 10); -has 'server_host' => (isa => Str, is => 'rw', lazy => 1, default => sub{shift->server }); -has 'server' => (isa => Str, is => 'rw'); -has 'port' => (isa => PosInt, is => 'rw', default => 5222); -has 'tls' => (isa => Bool, is => 'rw', default => '0'); -has 'connection_type' => (isa => Str, is => 'rw', default => 'tcpip'); -has 'conference_server' => (isa => Str, is => 'rw'); -has 'username' => (isa => Str, is => 'rw'); -has 'password' => (isa => Str, is => 'rw'); -has 'alias' => (isa => Str, is => 'rw', default => sub{'net_jabber_bot'}); +has 'client_session_id' => ( isa => Str, is => 'rw' ); +has 'connect_time' => ( isa => PosInt, is => 'rw', default => 9_999_999_999 ); +has 'forum_join_grace' => ( isa => PosNum, is => 'rw', default => 10 ); +has 'server_host' => ( isa => Str, is => 'rw', lazy => 1, default => sub { shift->server } ); +has 'server' => ( isa => Str, is => 'rw' ); +has 'port' => ( isa => PosInt, is => 'rw', default => 5222 ); +has 'tls' => ( isa => Bool, is => 'rw', default => '0' ); +has 'ssl_ca_path' => ( isa => Str, is => 'rw', default => Mozilla::CA::SSL_ca_file() ); +has 'ssl_verify' => ( isa => Bool, is => 'rw', default => '1' ); +has 'connection_type' => ( isa => Str, is => 'rw', default => 'tcpip' ); +has 'conference_server' => ( isa => Str, is => 'rw' ); +has 'username' => ( isa => Str, is => 'rw' ); +has 'password' => ( isa => Str, is => 'rw' ); +has 'alias' => ( isa => Str, lazy => 1, is => 'rw', default => 'net_jabber_bot' ); + # Resource defaults to alias_hostname_pid -has 'resource' => (isa => Str, lazy => 1, is => 'rw', default => sub{shift->alias . "_" . hostname . "_" . $$}); -#has 'resource' => (isa => Str, lazy => 1, is => 'rw', default => sub{shift->alias}); -has 'message_function' => (isa => Maybe[CodeRef], is => 'rw', default => sub{undef}); -has 'background_function' => (isa => Maybe[CodeRef], is => 'rw', default => sub{undef}); -has 'loop_sleep_time' => (isa => PosNum, is => 'rw', default => 5); -has 'process_timeout' => (isa => PosNum, is => 'rw', default => 5); -has 'from_full' => (isa => Str, is => 'rw', default => sub{my $self = shift; - $self->username . - '@' . - $self->server . - '/' . - $self->alias}); - - -has 'safety_mode' => (isa => Bool, is => 'rw', default => 1, coerce => 1); -has 'ignore_server_messages' => (isa => Bool, is => 'rw', default => 1, coerce => 1); -has 'ignore_self_messages' => (isa => Bool, is => 'rw', default => 1, coerce => 1); -has 'forums_and_responses' => (isa => HashRef[ArrayRef[Str]], is => 'rw'); # List of forums we're in and the strings we monitor for. -has 'forum_join_time' => (isa => HashRef[Int], is => 'rw', default => sub{{}}); # List of when we joined each forum -has 'out_messages_per_second' => (isa => PosNum, is => 'rw', default => sub{5}); -has 'message_delay' => (isa => PosNum, is => 'rw', default => sub {1/5}); +has 'resource' => ( isa => Str, lazy => 1, is => 'rw', default => sub { shift->alias . "_" . hostname . "_" . $$ } ); +has 'message_function' => ( isa => Maybe [CodeRef], is => 'rw', default => sub { undef } ); +has 'background_function' => ( isa => Maybe [CodeRef], is => 'rw', default => sub { undef } ); +has 'loop_sleep_time' => ( isa => PosNum, is => 'rw', default => 5 ); +has 'process_timeout' => ( isa => PosNum, is => 'rw', default => 5 ); +has 'from_full' => ( + isa => Str, + lazy => 1, + is => 'rw', + default => sub { + my $self = shift; + $self->username || '' . '@' . $self->server || '' . '/' . $self->alias || ''; + } +); + +has 'safety_mode' => ( isa => Bool, is => 'rw', default => 1, coerce => 1 ); +has 'ignore_server_messages' => ( isa => Bool, is => 'rw', default => 1, coerce => 1 ); +has 'ignore_self_messages' => ( isa => Bool, is => 'rw', default => 1, coerce => 1 ); +has 'forums_and_responses' => ( isa => HashRef [ ArrayRef [Str] ], is => 'rw' ); # List of forums we're in and the strings we monitor for. +has 'forum_join_time' => ( isa => HashRef [Int], is => 'rw', default => sub { {} } ); # List of when we joined each forum +has 'out_messages_per_second' => ( isa => PosNum, is => 'rw', default => sub { 5 } ); +has 'message_delay' => ( isa => PosNum, is => 'rw', default => sub { 1 / 5 } ); -has 'max_message_size' => (isa => HundredInt, is => 'rw', default => 1000000); -has 'max_messages_per_hour' => (isa => PosInt, is => 'rw', default => 1000000); +has 'max_message_size' => ( isa => HundredInt, is => 'rw', default => 1000000 ); +has 'max_messages_per_hour' => ( isa => PosInt, is => 'rw', default => 1000000 ); # Initialize this hour's message count. -has 'messages_sent_today' => (isa => 'HashRef', is => 'ro', default => sub{{(localtime)[7] => {(localtime)[2] => 0}}}); - +has 'messages_sent_today' => ( + isa => 'HashRef', + is => 'ro', + default => sub { + { (localtime)[7] => { (localtime)[2] => 0 } } + } +); #my %message_function : ATTR; # What is called if we are fed a new message once we are logged in. #my %bot_background_function : ATTR; # What is called if we are fed a new message once we are logged in. @@ -92,11 +102,11 @@ =head1 VERSION -Version 2.1.5 +Version 2.1.7 =cut -our $VERSION = '2.1.5'; +our $VERSION = '2.1.7'; =head1 SYNOPSIS @@ -143,46 +153,48 @@ =item B -Minimal: - my $bot = Net::Jabber::Bot->new( - server => 'host.domain.com' # Name of server when sending messages internally. - , conference_server => 'conference.host.domain.com' - , port => 522 - , username => 'username' - , password => 'pasword' - , safety_mode => 1 - , message_function => \&new_bot_message - , background_function => \&background_checks - , forums_and_responses => \%forum_list - ); - -All options: +Minimal: + my $bot = Net::Jabber::Bot->new( - server => 'host.domain.com' # Name of server when sending messages internally. - , conference_server => 'conference.host.domain.com' - , server_host => 'talk.domain.com' # used to specify what jabber server to connect to on connect? - , tls => 0 # set to 1 for google - , connection_type => 'tcpip' - , port => 522 - , username => 'username' - , password => 'pasword' - , alias => 'cpan_bot' - , message_function => \&new_bot_message - , background_function => \&background_checks - , loop_sleep_time => 15 - , process_timeout => 5 - , forums_and_responses => \%forum_list - , ignore_server_messages => 1 - , ignore_self_messages => 1 - , out_messages_per_second => 4 - , max_message_size => 1000 - , max_messages_per_hour => 100 - ); + server => 'host.domain.com', # Name of server when sending messages internally. + conference_server => 'conference.host.domain.com', + port => 522, + username => 'username', + password => 'pasword', + safety_mode => 1, + message_function => \&new_bot_message, + background_function => \&background_checks, + forums_and_responses => \%forum_list + ); +All options: + my $bot = Net::Jabber::Bot->new( + server => 'host.domain.com', # Name of server when sending messages internally. + conference_server => 'conference.host.domain.com', + server_host => 'talk.domain.com', # used to specify what jabber server to connect to on connect? + tls => 0, # set to 1 for google + ssl_ca_path => '', # path to your CA cert bundle + ssl_verify => 0, # for testing and for self-signed certificates + connection_type => 'tcpip', + port => 522, + username => 'username', + password => 'pasword', + alias => 'cpan_bot', + message_function => \&new_bot_message, + background_function => \&background_checks, + loop_sleep_time => 15, + process_timeout => 5, + forums_and_responses => \%forum_list, + ignore_server_messages => 1, + ignore_self_messages => 1, + out_messages_per_second => 4, + max_message_size => 1000, + max_messages_per_hour => 100 + ); -Setup the object and connect to the server. Hash values are passed to new as a hash. +Set up the object and connect to the server. Hash values are passed to new as a hash. The following initialization variables can be passed. Only marked variables are required (TODO) @@ -201,7 +213,7 @@ =item B Defaults to the same value set for 'server' above. -This is where the bot initially connects. For google for instance, you should set this to 'gmail.com' +This is where the bot initially connects. For google for instance, you should set this to 'gmail.com' =item B @@ -212,10 +224,20 @@ Defaults to 5222 =item B -Boolean value. defaults to 0. for google, it is know that this value must be 1 to work. + +Boolean value. defaults to 0. for google, it is know that this value must be 1 to work. + +=item B + +The path to your CA cert bundle. This is passed on to XML::Stream eventually. + +=item B + +Enable or disable server certificate validity check when connecting to server. This is passed on to XML::Stream eventually. =item B -defaults to 'tcpip' also takes 'http' + +defaults to 'tcpip' also takes 'http' =item B @@ -236,9 +258,9 @@ The found 'response string' is assumed to be at the beginning of the message. The message_funtion function will be called with the modified string. -alias = jbot:, attention: + alias = jbot:, attention: - example1: +example1: message: 'jbot: help' @@ -284,7 +306,7 @@ default: 1,000,000 -safetey: 1,000 +safety: 1,000 =item B @@ -292,7 +314,7 @@ default: 125 -safetey: 166 +safety: 166 =back @@ -300,41 +322,35 @@ # Handle initialization of objects of this class... sub BUILD { - my ($self, $params) = @_; + my ( $self, $params ) = @_; # Deal with legacy bug - if($params->{background_activity} || $params->{message_callback}) { - my $warn_message = "\n\n" - . "*" x 70 . "\n" - . "WARNING!!! You're using old parameters for your bot initialization\n" - . "'message_callback' should be changed to 'message_function'\n" - . "'background_activity' should be changed to 'background_function'\n" - . "I'm correcting this, but you should fix your code\n" - . "*" x 70 . "\n" - . "\n\n"; + if ( $params->{background_activity} || $params->{message_callback} ) { + my $warn_message = "\n\n" . "*" x 70 . "\n" . "WARNING!!! You're using old parameters for your bot initialization\n" . "'message_callback' should be changed to 'message_function'\n" . "'background_activity' should be changed to 'background_function'\n" . "I'm correcting this, but you should fix your code\n" . "*" x 70 . "\n" . "\n\n"; warn($warn_message); WARN($warn_message); - $self->background_function($params->{background_activity}) - if(!$self->background_function && $params->{background_activity}); - $self->message_function($params->{message_callback}) - if(!$self->message_function && $params->{message_callback}); + $self->background_function( $params->{background_activity} ) + if ( !$self->background_function && $params->{background_activity} ); + $self->message_function( $params->{message_callback} ) + if ( !$self->message_function && $params->{message_callback} ); sleep 30; - } - + } + # Message delay is inverse of out_messages_per_second - $self->message_delay(1/$self->out_messages_per_second); + $self->message_delay( 1 / $self->out_messages_per_second ); # Enforce all our safety restrictions here. - if($self->safety_mode) { + if ( $self->safety_mode ) { + # more than 5 messages per second risks server flooding. - $self->message_delay(1/5) if($self->message_delay < 1/5); + $self->message_delay( 1 / 5 ) if ( $self->message_delay < 1 / 5 ); # Messages should be small to not overwhelm rooms/people/server - $self->max_message_size(1000) if($self->max_message_size > 1000); + $self->max_message_size(1000) if ( $self->max_message_size > 1000 ); # More than 4,000 messages a day is a little excessive. - $self->max_messages_per_hour(125) if($self->max_messages_per_hour > 166); + $self->max_messages_per_hour(125) if ( $self->max_messages_per_hour > 166 ); # Should not be responding to self messages to prevent loops. $self->ignore_self_messages(1); @@ -346,72 +362,70 @@ # Return a code reference that will pass self in addition to arguements passed to callback code ref. sub _callback_maker { - my $self = shift; + my $self = shift; my $Function = shift; -# return sub {return $code_ref->($self, @_);}; - return sub {return $Function->($self, @_);}; + # return sub {return $code_ref->($self, @_);}; + return sub { return $Function->( $self, @_ ); }; } # Creates client object and manages connection. Called on new but also called by re-connect sub _init_jabber { my $self = shift; - # Determine if the object already exists and if not, create it. - DEBUG("new client object."); - if(!$self->jabber_client) { - $self->jabber_client(Net::Jabber::Client->new); - } + # Autocreate the jabber object (see has jabber_client) my $connection = $self->jabber_client; DEBUG("Set the call backs."); - $connection->PresenceDB(); # Init presence DB. - $connection->RosterDB(); # Init Roster DB. - $connection->SetCallBacks( 'message' => $self->_callback_maker(\&_process_jabber_message) - ,'presence' => $self->_callback_maker(\&_jabber_presence_message) - ,'iq' => $self->_callback_maker(\&_jabber_in_iq_message) - ); + $connection->PresenceDB(); # Init presence DB. + $connection->RosterDB(); # Init Roster DB. + $connection->SetCallBacks( + 'message' => $self->_callback_maker( \&_process_jabber_message ), 'presence' => $self->_callback_maker( \&_jabber_presence_message ) + , 'iq' => $self->_callback_maker( \&_jabber_in_iq_message ) + ); - DEBUG("Connect. hostname => " . $self->server . ", port => " . $self->port); + DEBUG( "Connect. hostname => " . $self->server . ", port => " . $self->port ); my %client_connect_hash = ( - hostname => $self->server, - port => $self->port, - tls => $self->tls, + hostname => $self->server, + port => $self->port, + tls => $self->tls, + ssl_ca_path => $self->ssl_ca_path, + ssl_verify => $self->ssl_verify, connectiontype => $self->connection_type, componentname => $self->server_host, ); my $status = $connection->Connect(%client_connect_hash); - if(!defined $status) { - ERROR("ERROR: Jabber server is down or connection was not allowed: $!"); - die("Jabber server is down or connection was not allowed: $!"); - } - - DEBUG("Logging in... as user " . $self->username . " / " . $self->resource); - DEBUG("PW: " . $self->password); - -# Moved into connect hash via 'componentname' -# my $sid = $connection->{SESSION}->{id}; -# $connection->{STREAM}->{SIDS}->{$sid}->{hostname} = $self->server_host; - - - my @auth_result = $connection->AuthSend(username => $self->username, - password => $self->password, - resource => $self->resource, - ); + if ( !defined $status ) { + ERROR("ERROR: Jabber server is down or connection was not allowed: $!"); + die("Jabber server is down or connection was not allowed: $!"); + } + + DEBUG( "Logging in... as user " . $self->username . " / " . $self->resource ); + DEBUG( "PW: " . $self->password ); + + # Moved into connect hash via 'componentname' + # my $sid = $connection->{SESSION}->{id}; + # $connection->{STREAM}->{SIDS}->{$sid}->{hostname} = $self->server_host; + + my @auth_result = $connection->AuthSend( + username => $self->username, + password => $self->password, + resource => $self->resource, + ); - if(!defined $auth_result[0] || $auth_result[0] ne "ok") { - ERROR("Authorization failed: for " . $self->username . " / " . $self->resource); + if ( !defined $auth_result[0] || $auth_result[0] ne "ok" ) { + ERROR( "Authorization failed: for " . $self->username . " / " . $self->resource ); foreach my $result (@auth_result) { ERROR("$result"); } - die("Failed to re-connect: " . join("\n", @auth_result)); + die( "Failed to re-connect: " . join( "\n", @auth_result ) ); } $connection->RosterRequest(); - $self->client_session_id($connection->{SESSION}->{id}); + $self->client_session_id( $connection->{SESSION}->{id} ); DEBUG("Sending presence to tell world that we are logged in"); $connection->PresenceSend(); @@ -421,12 +435,12 @@ $connection->RosterGet(); $self->Process(5); - foreach my $forum (keys %{$self->forums_and_responses}) { + foreach my $forum ( keys %{ $self->forums_and_responses } ) { $self->JoinForum($forum); } - INFO("Connected to server '" . $self->server . "' successfully"); - $self->connect_time(time); # Track when we came online. + INFO( "Connected to server '" . $self->server . "' successfully" ); + $self->connect_time(time); # Track when we came online. return 1; } @@ -441,18 +455,19 @@ =cut sub JoinForum { - my $self = shift; + my $self = shift; my $forum_name = shift; - DEBUG("Joining $forum_name on " . $self->conference_server . " as " . $self->alias); + DEBUG( "Joining $forum_name on " . $self->conference_server . " as " . $self->alias ); - $self->jabber_client->MUCJoin(room => $forum_name, - server => $self->conference_server, - nick => $self->alias, - ); + $self->jabber_client->MUCJoin( + room => $forum_name, + server => $self->conference_server, + nick => $self->alias, + ); $self->forum_join_time->{$forum_name} = time; - DEBUG("Sleeping " . $self->message_delay . " seconds"); + DEBUG( "Sleeping " . $self->message_delay . " seconds" ); Time::HiRes::sleep $self->message_delay; } @@ -465,12 +480,12 @@ =cut -sub Process { # Call connection process. - my $self = shift; +sub Process { # Call connection process. + my $self = shift; my $timeout_seconds = shift; #If not passed explicitly - $timeout_seconds = $self->process_timeout if(!defined $timeout_seconds); + $timeout_seconds = $self->process_timeout if ( !defined $timeout_seconds ); my $process_return = $self->jabber_client->Process($timeout_seconds); return $process_return; @@ -479,10 +494,18 @@ =item B Primary subroutine save new called by the program. Does an endless loop of: -1. Process -2. If Process failed, Reconnect to server over larger and larger timeout -3. run background process fed from new, telling it who I am and how many loops we have been through. -4. Enforce a sleep to prevent server floods. + +=over + +=item 1. Process + +=item 2. If Process failed, Reconnect to server over larger and larger timeout + +=item 3. run background process fed from new, telling it who I am and how many loops we have been through. + +=item 4. Enforce a sleep to prevent server floods. + +=back =cut @@ -490,29 +513,30 @@ my $self = shift; my $time_between_background_routines = $self->loop_sleep_time; - my $process_timeout = $self->process_timeout; - my $background_subroutine = $self->background_function; - my $message_delay = $self->message_delay; + my $process_timeout = $self->process_timeout; + my $background_subroutine = $self->background_function; + my $message_delay = $self->message_delay; - my $last_background = time - $time_between_background_routines - 1; # Call background process every so often... - my $counter = 0; # Keep track of how many times we've looped. Not sure if we'll use this long term. + my $last_background = time - $time_between_background_routines - 1; # Call background process every so often... + my $counter = 0; # Keep track of how many times we've looped. Not sure if we'll use this long term. - while(1) { # Loop for ever! - # Process and re-connect if you have to. + while (1) { # Loop for ever! + # Process and re-connect if you have to. my $reconnect_timeout = 1; - eval {$self->Process($process_timeout)}; + eval { $self->Process($process_timeout) }; + + if ($@) { #Assume the connection is down... + ERROR("Server error: $@"); + my $message = "Disconnected from " . $self->server . ":" . $self->port . " as " . $self->username; - if($@) { #Assume the connection is down... - my $message = "Disconnected from " . $self->server . ":" . $self->port - . " as " . $self->username; ERROR("$message Reconnecting..."); - sleep 5; # TODO: Make re-connect time flexible somehow + sleep 5; # TODO: Make re-connect time flexible somehow $self->ReconnectToServer(); } # Call background function - if(defined $background_subroutine && $last_background + $time_between_background_routines < time) { - &$background_subroutine($self, ++$counter); + if ( defined $background_subroutine && $last_background + $time_between_background_routines < time ) { + &$background_subroutine( $self, ++$counter ); $last_background = time; } Time::HiRes::sleep $message_delay; @@ -523,9 +547,10 @@ You should not ever need to use this. the Start() kernel usually figures this out and calls it. -Internal process -1. Disconnects -3. Re-initializes +Internal process: + + 1. Disconnects + 3. Re-initializes =cut @@ -537,13 +562,13 @@ $self->Disconnect(); my $sleep_time = 5; - while (!$self->IsConnected()) { # jabber_client variable defines if we're connected. + while ( !$self->IsConnected() ) { # jabber_client variable defines if we're connected. INFO("Sleeping $sleep_time before attempting re-connect"); sleep $sleep_time; - $sleep_time *= 2 if($sleep_time < 300); + $sleep_time *= 2 if ( $sleep_time < 300 ); $self->InitJabber(); INFO("Running background routine."); - &$background_subroutine($self, 0); # call background proc so we can check for errors while down. + &$background_subroutine( $self, 0 ); # call background proc so we can check for errors while down. } } @@ -553,14 +578,13 @@ =cut - sub Disconnect { my $self = shift; - $self->connect_time('9' x 10); # Way in the future + $self->connect_time( '9' x 10 ); # Way in the future INFO("Disconnecting from server"); - return if(!defined $self->jabber_client); # do not proceed, no object. + return if ( !defined $self->jabber_client ); # do not proceed, no object. $self->jabber_client->Disconnect(); my $old_client = $self->jabber_client; @@ -579,14 +603,15 @@ sub IsConnected { my $self = shift; - DEBUG("REF = " . ref($self->jabber_client)); + DEBUG( "REF = " . ref( $self->jabber_client ) ); return $self->connect_time; } # TODO: ***NEED VERY GOOD DOCUMENTATION HERE***** + =item B<_process_jabber_message> - DO NOT CALL -Handles incoming messages. +Handles incoming messages. =cut @@ -595,53 +620,52 @@ DEBUG("_process_jabber_message called"); my $session_id = shift; - my $message = shift; + my $message = shift; - my $type = $message->GetType(); - my $fromJID = $message->GetFrom("jid"); + my $type = $message->GetType(); + my $fromJID = $message->GetFrom("jid"); my $from_full = $message->GetFrom(); - my $from = $fromJID->GetUserID(); + my $from = $fromJID->GetUserID(); my $resource = $fromJID->GetResource(); - my $subject = $message->GetSubject(); - my $body = $message->GetBody(); + my $subject = $message->GetSubject(); + my $body = $message->GetBody(); my $reply_to = $from_full; - $reply_to =~ s/\/.*$// if($type eq 'groupchat'); + $reply_to =~ s/\/.*$// if ( $type eq 'groupchat' ); - # TODO: + # TODO: # Don't know exactly why but when a message comes from gtalk-web-interface, it works well, but if the message comes from Gtalk client, bot dies # my $message_date_text; eval { $message_date_text = $message->GetTimeStamp(); } ; # Eval is a really bad idea. we need to understand why this is failing. # my $message_date_text = $message->GetTimeStamp(); # Since we're not using the data, we'll turn this off since it crashes gtalk clients aparently? # my $message_date = UnixDate($message_date_text, "%s") - 1*60*60; # Convert to EST from CST; - # Ignore any messages within 10 seconds of start or join of that forum + # Ignore any messages within 'forum_join_grace' seconds of start or join of that forum my $grace_period = $self->forum_join_grace; - my $time_now = time; - if($self->connect_time > $time_now - $grace_period - || (defined $self->forum_join_time->{$from} && $self->forum_join_time->{$from} > $time_now - $grace_period)) { + my $time_now = time; + if ( $self->connect_time > $time_now - $grace_period + || ( defined $self->forum_join_time->{$from} && $self->forum_join_time->{$from} > $time_now - $grace_period ) ) { my $cond1 = $self->connect_time . " > $time_now - $grace_period"; - my $cond2 = $self->forum_join_time->{$from} || 'undef' - . " > $time_now - $grace_period"; + my $cond2 = $self->forum_join_time->{$from} || 'undef' . " > $time_now - $grace_period"; DEBUG("Ignoring messages cause I'm in startup for forum $from\n$cond1\n$cond2"); - return; # Ignore messages the first few seconds. + return; # Ignore messages the first few seconds. } # Ignore Group messages with no resource on them. (Server Messages?) - if($self->ignore_server_messages) { - if($from_full !~ m/^([^\@]+)\@([^\/]+)\/(.+)$/) { - DEBUG("Server message? ($from_full) - $message"); - return if($from_full !~ m/^([^\@]+)\@([^\/]+)\//); + if ( $self->ignore_server_messages ) { + if ( $from_full !~ m/^([^\@]+)\@([^\/]+)\/(.+)$/ ) { + DEBUG("Server message? ($from_full) - $message"); + return if ( $from_full !~ m/^([^\@]+)\@([^\/]+)\// ); ERROR("Couldn't recognize from_full ($from_full). Ignoring message: $body"); return; } } # Are these my own messages? - if($self->ignore_self_messages ) { # TODO: || $self->safety_mode (this breaks tests in 06?) - - if(defined $resource && $resource eq $self->resource) { # Ignore my own messages. + if ( $self->ignore_self_messages ) { # TODO: || $self->safety_mode (this breaks tests in 06?) + + if ( defined $resource && $resource eq $self->resource ) { # Ignore my own messages. DEBUG("Ignoring message from self...\n"); return; } @@ -651,32 +675,34 @@ my $bot_address_from; my @aliases_to_respond_to = $self->get_responses($from); - if($#aliases_to_respond_to >= 0 and $type eq 'groupchat') { + if ( $#aliases_to_respond_to >= 0 and $type eq 'groupchat' ) { my $request; foreach my $address_type (@aliases_to_respond_to) { my $qm_address_type = quotemeta($address_type); - next if($body !~ m/^\s*$qm_address_type\s*(\S.*)$/ms); - $request = $1; + next if ( $body !~ m/^\s*$qm_address_type\s*(\S.*)$/ms ); + $request = $1; $bot_address_from = $address_type; - last; # do not need to loop any more. + last; # do not need to loop any more. } DEBUG("Message not relevant to bot"); - return if(!defined $request); + return if ( !defined $request ); $body = $request; } # Call the message callback if it's defined. - if( defined $self->message_function) { - $self->message_function->(bot_object => $self, - from_full => $from_full, - body => $body, - type => $type, - reply_to => $reply_to, - bot_address_from => $bot_address_from, - message => $message - ); + if ( defined $self->message_function ) { + $self->message_function->( + bot_object => $self, + from_full => $from_full, + body => $body, + type => $type, + reply_to => $reply_to, + bot_address_from => $bot_address_from, + message => $message + ); return; - } else { + } + else { WARN("No handler for messages!"); INFO("New Message: $type from $from ($resource). sub=$subject -- $body"); } @@ -695,20 +721,19 @@ my $forum = shift; - if(!defined $forum) { - WARN("No forum supplied for get_responses()"); - return; + if ( !defined $forum ) { + WARN("No forum supplied for get_responses()"); + return; } my @aliases_to_respond_to; - if(defined $self->forums_and_responses->{$forum}) { - @aliases_to_respond_to = @{$self->forums_and_responses->{$forum}}; + if ( defined $self->forums_and_responses->{$forum} ) { + @aliases_to_respond_to = @{ $self->forums_and_responses->{$forum} }; } return @aliases_to_respond_to; } - =item B<_jabber_in_iq_message> - DO NOT CALL Called when the client receives new messages during Process of this type. @@ -719,37 +744,48 @@ my $self = shift; my $session_id = shift; - my $iq = shift; + my $iq = shift; - DEBUG("IQ Message:" . $iq->GetXML()); + DEBUG( "IQ Message:" . $iq->GetXML() ); my $from = $iq->GetFrom(); -# my $type = $iq->GetType();DEBUG("Type=$type"); - my $query = $iq->GetQuery();#DEBUG("query=" . Dumper($query)); - my $xmlns = $query->GetXMLNS();DEBUG("xmlns=$xmlns"); + + # my $type = $iq->GetType();DEBUG("Type=$type"); + my $query = $iq->GetQuery(); #DEBUG("query=" . Dumper($query)); + + if ( !$query ) { + DEBUG("iq->GetQuery() returned undef."); + return; + } + + my $xmlns = $query->GetXMLNS(); + DEBUG("xmlns=$xmlns"); my $iqReply; # Respond to version requests with information about myself. - if($xmlns eq "jabber:iq:version") { + if ( $xmlns eq "jabber:iq:version" ) { + # convert 5.010000 to 5.10.0 my $perl_version = $]; - $perl_version =~ s/(\d{3})(?=\d)/$1./g; + $perl_version =~ s/(\d{3})(?=\d)/$1./g; $perl_version =~ s/\.0+(\d)/.$1/; - - $self->jabber_client - ->VersionSend(to=> $from, - name=>__PACKAGE__, - ver=> $VERSION, - os=> "Perl v$perl_version"); - } else { # Unknown request. Just ignore it. + + $self->jabber_client->VersionSend( + to => $from, + name => __PACKAGE__, + ver => $VERSION, + os => "Perl v$perl_version" + ); + } + else { # Unknown request. Just ignore it. return; } - if($iqReply) { - DEBUG("Reply: ", $iqReply->GetXML()); + if ($iqReply) { + DEBUG( "Reply: ", $iqReply->GetXML() ); $self->jabber_client->Send($iqReply); } -# INFO("IQ from $from ($type). XMLNS: $xmlns"); + # INFO("IQ from $from ($type). XMLNS: $xmlns"); } =item B<_jabber_presence_message> - DO NOT CALL @@ -763,34 +799,43 @@ my $self = shift; my $session_id = shift; - my $presence = shift; + my $presence = shift; my $type = $presence->GetType(); - if($type eq 'subscribe') { # Always allow people to subscribe to us. Why wouldn't we? + if ( $type eq 'subscribe' ) { # Always allow people to subscribe to us. Why wouldn't we? my $from = $presence->GetFrom(); - $self->jabber_client->Subscription(type=>"subscribe", - to=>$from); - $self->jabber_client->Subscription(type=>"subscribed",to=>$from); + $self->jabber_client->Subscription( + type => "subscribe", + to => $from + ); + $self->jabber_client->Subscription( type => "subscribed", to => $from ); INFO("Processed subscription request from $from"); return; - } elsif($type eq 'unsubscribe') { # Always allow people to subscribe to us. Why wouldn't we? + } + elsif ( $type eq 'unsubscribe' ) { # Always allow people to subscribe to us. Why wouldn't we? my $from = $presence->GetFrom(); - $self->jabber_client->Subscription(type=>"unsubscribed", - to=>$from); + $self->jabber_client->Subscription( + type => "unsubscribed", + to => $from + ); INFO("Processed unsubscribe request from $from"); return; } - $self->jabber_client->PresenceDBParse($presence); # Since we are always an object just throw it into the db. + # Without explicitly setting a priority, XMPP::Protocol will store all JIDs with an empty + # priority under the same key rather than in an array. + $presence->SetPriority(0) unless $presence->GetPriority(); + + $self->jabber_client->PresenceDBParse($presence); # Since we are always an object just throw it into the db. my $from = $presence->GetFrom(); - $from = "." if(!defined $from); + $from = "." if ( !defined $from ); my $status = $presence->GetStatus(); - $status = "." if(!defined $status); + $status = "." if ( !defined $status ); DEBUG("Presence From $from t=$type s=$status"); - DEBUG("Presence XML: " . $presence->GetXML()); + DEBUG( "Presence XML: " . $presence->GetXML() ); } =item B @@ -802,14 +847,13 @@ =cut - sub respond_to_self_messages { my $self = shift; my $setting = shift; - $setting = 1 if(!defined $setting); + $setting = 1 if ( !defined $setting ); - $self->ignore_self_messages(!$setting); + $self->ignore_self_messages( !$setting ); return !!$setting; } @@ -821,14 +865,13 @@ =cut - sub get_messages_this_hour { my $self = shift; - my $yday = (localtime)[7]; - my $hour = (localtime)[2]; + my $yday = (localtime)[7]; + my $hour = (localtime)[2]; my $messages_this_hour = $self->messages_sent_today->{$yday}->{$hour}; - return $messages_this_hour || 0; # Assure it's not undef to avoid math warnings + return $messages_this_hour || 0; # Assure it's not undef to avoid math warnings } =item B @@ -841,13 +884,13 @@ my $self = shift; # Must be in safety mode and all thresholds met. - my $mode = $self->safety_mode - && $self->message_delay >= 1/5 - && $self->max_message_size <= 1000 - && $self->max_messages_per_hour <= 166 - && $self->ignore_self_messages - ; - + my $mode = + $self->safety_mode + && $self->message_delay >= 1 / 5 + && $self->max_message_size <= 1000 + && $self->max_messages_per_hour <= 166 + && $self->ignore_self_messages; + return $mode || 0; } @@ -860,13 +903,13 @@ =cut sub SendGroupMessage { - my $self = shift; + my $self = shift; my $recipient = shift; - my $message = shift; + my $message = shift; - $recipient .= '@' . $self->conference_server if($recipient !~ m{\@}); + $recipient .= '@' . $self->conference_server if ( $recipient !~ m{\@} ); - return $self->SendJabberMessage($recipient, $message, 'groupchat'); + return $self->SendJabberMessage( $recipient, $message, 'groupchat' ); } =item B @@ -880,11 +923,11 @@ =cut sub SendPersonalMessage { - my $self = shift; + my $self = shift; my $recipient = shift; - my $message = shift; + my $message = shift; - return $self->SendJabberMessage($recipient, $message, 'chat'); + return $self->SendJabberMessage( $recipient, $message, 'chat' ); } =item B @@ -903,10 +946,10 @@ sub SendJabberMessage { my $self = shift; - my $recipient = shift; - my $message = shift; + my $recipient = shift; + my $message = shift; my $message_type = shift; - my $subject = shift; + my $subject = shift; my $max_size = $self->max_message_size; @@ -914,12 +957,11 @@ # Split on new line. Space if you have to or just chop at max size. my @message_chunks = ( $message =~ /.{1,$max_size}$|.{1,$max_size}\n|.{1,$max_size}\s|.{1,$max_size}/gs ); - - DEBUG("Max message = $max_size. Splitting...") if($#message_chunks > 0); + DEBUG("Max message = $max_size. Splitting...") if ( $#message_chunks > 0 ); my $return_value; foreach my $message_chunk (@message_chunks) { - my $msg_return = $self->_send_individual_message($recipient, $message_chunk, $message_type, $subject); - if(defined $msg_return) { + my $msg_return = $self->_send_individual_message( $recipient, $message_chunk, $message_type, $subject ); + if ( defined $msg_return ) { $return_value .= $msg_return; } } @@ -936,17 +978,17 @@ sub _send_individual_message { my $self = shift; - my $recipient = shift; + my $recipient = shift; my $message_chunk = shift; - my $message_type = shift; - my $subject = shift; + my $message_type = shift; + my $subject = shift; - if(!defined $message_type) { + if ( !defined $message_type ) { ERROR("Undefined \$message_type"); return "No message type!\n"; } - if(!defined $recipient) { + if ( !defined $recipient ) { ERROR('$recipient not defined!'); return "No recipient!\n"; } @@ -955,62 +997,53 @@ my $hour = (localtime)[2]; my $messages_this_hour = $self->messages_sent_today->{$yday}->{$hour} += 1; - if($messages_this_hour > $self->max_messages_per_hour) { - $subject = "" if(!defined $subject); # Keep warning messages quiet. - $message_chunk = "" if(!defined $message_chunk); # Keep warning messages quiet. - - ERROR("Can't Send message because we've already tried to send $messages_this_hour of $self->max_messages_per_hour messages this hour.\n" - . "To: $recipient\n" - . "Subject: $subject\n" - . "Type: $message_type\n" - . "Message sent:\n" - . "$message_chunk" - ); + if ( $messages_this_hour > $self->max_messages_per_hour ) { + $subject = "" if ( !defined $subject ); # Keep warning messages quiet. + $message_chunk = "" if ( !defined $message_chunk ); # Keep warning messages quiet. + + ERROR( "Can't Send message because we've already tried to send $messages_this_hour of $self->max_messages_per_hour messages this hour.\n" . "To: $recipient\n" . "Subject: $subject\n" . "Type: $message_type\n" . "Message sent:\n" . "$message_chunk" ); # Send 1 panic message out to jabber if this is our last message before quieting down. return "Too many messages ($messages_this_hour)\n"; } - if(!$self->IsConnected) { - $subject = "" if(!defined $subject); # Keep warning messages quiet. - $message_chunk = "" if(!defined $message_chunk); # Keep warning messages quiet. - - ERROR("Can't Jabber server is down. Tried to send: \n" - . "To: $recipient\n" - . "Subject: $subject\n" - . "Type: $message_type\n" - . "Message sent:\n" - . "$message_chunk" - ); + if ( !$self->IsConnected ) { + $subject = "" if ( !defined $subject ); # Keep warning messages quiet. + $message_chunk = "" if ( !defined $message_chunk ); # Keep warning messages quiet. + + ERROR( "Can't Jabber server is down. Tried to send: \n" . "To: $recipient\n" . "Subject: $subject\n" . "Type: $message_type\n" . "Message sent:\n" . "$message_chunk" ); # Send 1 panic message out to jabber if this is our last message before quieting down. return "Server is down.\n"; } - # Strip out anything that's not a printable character + # Strip out anything that's not a printable character except new line, we want to be able to send multiline message, aren't we? # Now with unicode support? - $message_chunk =~ s/[^[:print:]]+/./xmsg; + $message_chunk =~ s/[^\r\n[:print:]]+/./xmsg; my $message_length = length($message_chunk); DEBUG("Sending message $yday-$hour-$messages_this_hour $message_length bytes to $recipient"); - $self->jabber_client->MessageSend(to => $recipient - , body => $message_chunk - , type => $message_type -# , from => $connection_hash{$obj_ID}{'from_full'} - , subject => $subject - ); - - DEBUG("Sleeping " . $self->message_delay . " after sending message."); - Time::HiRes::sleep $self->message_delay; #Throttle messages. - - if($messages_this_hour == $self->max_messages_per_hour) { - $self->jabber_client->MessageSend(to => $recipient - , body => "Cannot send more messages this hour. " - . "$messages_this_hour of " . $self->max_messages_per_hour . " already sent." - , type => $message_type - ); + $self->jabber_client->MessageSend( + to => $recipient, body => $message_chunk + , type => $message_type + + # , from => $connection_hash{$obj_ID}{'from_full'} + , subject => $subject + ); + + DEBUG( "Sleeping " . $self->message_delay . " after sending message." ); + Time::HiRes::sleep $self->message_delay; #Throttle messages. + + if ( $messages_this_hour == $self->max_messages_per_hour ) { + $self->jabber_client->MessageSend( + to => $recipient, body => "Cannot send more messages this hour. " + . "$messages_this_hour of " + . $self->max_messages_per_hour + . " already sent." + , type => $message_type + ); } - return; # Means we succeeded! + return; # Means we succeeded! } =item B @@ -1025,16 +1058,16 @@ my $self = shift; my $recipient = shift; - my $subject = shift; + my $subject = shift; - if(length $subject > $self->max_message_size) { - my $subject_len = length($subject); - ERROR("Someone tried to send a subject message $subject_len bytes long!"); - my $subject = substr($subject, 0, $self->max_message_size); - DEBUG("Truncated subject: $subject"); - return "Subject is too long!"; + if ( length $subject > $self->max_message_size ) { + my $subject_len = length($subject); + ERROR("Someone tried to send a subject message $subject_len bytes long!"); + my $subject = substr( $subject, 0, $self->max_message_size ); + DEBUG("Truncated subject: $subject"); + return "Subject is too long!"; } - $self->_send_individual_message($recipient, "Setting subject to $subject", 'groupchat', $subject); + $self->_send_individual_message( $recipient, "Setting subject to $subject", 'groupchat', $subject ); return; } @@ -1050,11 +1083,11 @@ =cut sub ChangeStatus { - my $self = shift; + my $self = shift; my $presence_mode = shift; - my $status_string = shift; # (optional) + my $status_string = shift; # (optional) - $self->jabber_client->PresenceSend(show=>$presence_mode, status=>$status_string); + $self->jabber_client->PresenceSend( show => $presence_mode, status => $status_string ); return 1; } @@ -1072,9 +1105,9 @@ my $self = shift; my @rosterlist; - foreach my $jid ($self->jabber_client->RosterDBJIDs()) { - my $username =$jid->GetJID(); - push(@rosterlist, $username) ; + foreach my $jid ( $self->jabber_client->RosterDBJIDs() ) { + my $username = $jid->GetJID(); + push( @rosterlist, $username ); } return @rosterlist; } @@ -1092,9 +1125,9 @@ my $Pres = $self->jabber_client->PresenceDBQuery($jid); - if (!(defined($Pres))) { + if ( !( defined($Pres) ) ) { - return "unavailable" ; + return "unavailable"; } my $show = $Pres->GetShow(); @@ -1117,8 +1150,8 @@ my $self = shift; my $user = shift; - $self->jabber_client->Subscription(type=>"subscribe", to=>$user); - $self->jabber_client->Subscription(type=>"subscribed",to=>$user); + $self->jabber_client->Subscription( type => "subscribe", to => $user ); + $self->jabber_client->Subscription( type => "subscribed", to => $user ); } =item B @@ -1131,9 +1164,10 @@ my $self = shift; my $user = shift; - $self->jabber_client->Subscription(type=>"unsubscribe", to=>$user); - $self->jabber_client->Subscription(type=>"unsubscribed",to=>$user); + $self->jabber_client->Subscription( type => "unsubscribe", to => $user ); + $self->jabber_client->Subscription( type => "unsubscribed", to => $user ); } + =back =head1 AUTHOR @@ -1166,17 +1200,13 @@ L -=item * Search CPAN - -L - -=item * Project homepage +=item * Metacpan -L +L -=item * Google Issue Tracker (reporting bugs) +=item * Github -L +L =back @@ -1194,4 +1224,4 @@ __PACKAGE__->meta->make_immutable; no Moose; no MooseX::Types; -1; # End of Net::Jabber::Bot +1; # End of Net::Jabber::Bot diff -Nru libnet-jabber-bot-perl-2.1.5/Makefile.PL libnet-jabber-bot-perl-2.1.7/Makefile.PL --- libnet-jabber-bot-perl-2.1.5/Makefile.PL 2009-08-24 15:58:16.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/Makefile.PL 2020-01-18 07:10:17.000000000 +0000 @@ -4,7 +4,7 @@ WriteMakefile( NAME => 'Net::Jabber::Bot', - AUTHOR => 'Todd E Rinaldo ', + AUTHOR => 'Todd E Rinaldo ', VERSION_FROM => 'lib/Net/Jabber/Bot.pm', ABSTRACT_FROM => 'lib/Net/Jabber/Bot.pm', PL_FILES => {}, @@ -12,6 +12,7 @@ PREREQ_PM => { 'Moose' => 0.82, # Object Base 'MooseX::Types' => 0.12, # New variable types + 'Mozilla::CA' => 0, # SSL Cert support. 'Time::HiRes' => 0, # Partial second sleeping 'Net::Jabber' => 2.0, # The whole thing is based on Net::Jabber. 'Log::Log4perl' => 0, # We use log4perl. not sure how bad this'll screw people over... should consider removal later or make it optional @@ -25,10 +26,6 @@ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Net-Jabber-Bot-*' }, META_MERGE => { - recommends => { - 'Test::Pod::Coverage' => 1.04, - 'Test::Pod' => 1.14, - }, build_requires => { 'Test::More' => 0, # For testing 'Test::NoWarnings' => 0, # For testing @@ -38,9 +35,9 @@ resources => { license => 'http://dev.perl.org/licenses/', homepage => 'http://wiki.github.com/toddr/perl-net-jabber-bot', - bugtracker => 'http://code.google.com/p/perl-net-jabber-bot/issues/list', + bugtracker => 'https://github.com/toddr/perl-net-jabber-bot/issues', repository => 'http://github.com/toddr/perl-net-jabber-bot/tree/master', - MailingList => 'http://groups.google.com/group/perl-net-jabber-bot', +# MailingList => 'http://groups.google.com/group/perl-net-jabber-bot', }, }, ); diff -Nru libnet-jabber-bot-perl-2.1.5/MANIFEST libnet-jabber-bot-perl-2.1.7/MANIFEST --- libnet-jabber-bot-perl-2.1.5/MANIFEST 2009-08-24 15:57:08.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/MANIFEST 2020-11-15 21:07:00.000000000 +0000 @@ -1,16 +1,18 @@ Changes -MANIFEST -META.yml -Makefile.PL -README -examples/gtalk_RSSbot.pl examples/bot_example.pl +examples/gtalk_RSSbot.pl lib/Net/Jabber/Bot.pm -t/lib/MockJabberClient.pm +Makefile.PL +MANIFEST +MANIFEST.SKIP +README.md +t/00-load.t t/03-test_connectivity.t -t/99-pod.t -t/test_config.sample -t/06-test_safeties.t t/05-helper_functions.t +t/06-test_safeties.t t/99-pod-coverage.t -t/00-load.t +t/99-pod.t +t/lib/MockJabberClient.pm +t/test_config.sample +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -Nru libnet-jabber-bot-perl-2.1.5/MANIFEST.SKIP libnet-jabber-bot-perl-2.1.7/MANIFEST.SKIP --- libnet-jabber-bot-perl-2.1.5/MANIFEST.SKIP 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/MANIFEST.SKIP 2020-01-18 07:28:16.000000000 +0000 @@ -0,0 +1,6 @@ +^.github/ +^.git/.* +^MYMETA.* +^MANIFEST.bak +^.gitignore +^Makefile$ \ No newline at end of file diff -Nru libnet-jabber-bot-perl-2.1.5/META.json libnet-jabber-bot-perl-2.1.7/META.json --- libnet-jabber-bot-perl-2.1.5/META.json 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/META.json 2020-11-15 21:07:00.000000000 +0000 @@ -0,0 +1,69 @@ +{ + "abstract" : "Automated Bot creation with safeties", + "author" : [ + "Todd E Rinaldo " + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "Net-Jabber-Bot", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "0", + "FindBin" : "0", + "Test::More" : "0", + "Test::NoWarnings" : "0", + "lib" : "0" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "FindBin" : "0", + "Log::Log4perl" : "0", + "Moose" : "0.82", + "MooseX::Types" : "0.12", + "Mozilla::CA" : "0", + "Net::Jabber" : "2", + "Sys::Hostname" : "0", + "Test::More" : "0", + "Test::NoWarnings" : "0", + "Time::HiRes" : "0", + "lib" : "0", + "version" : "0" + } + } + }, + "release_status" : "stable", + "resources" : { + "bugtracker" : { + "web" : "https://github.com/toddr/perl-net-jabber-bot/issues" + }, + "homepage" : "http://wiki.github.com/toddr/perl-net-jabber-bot", + "license" : [ + "http://dev.perl.org/licenses/" + ], + "repository" : { + "url" : "http://github.com/toddr/perl-net-jabber-bot/tree/master" + } + }, + "version" : "v2.1.7", + "x_serialization_backend" : "JSON::PP version 4.04" +} diff -Nru libnet-jabber-bot-perl-2.1.5/META.yml libnet-jabber-bot-perl-2.1.7/META.yml --- libnet-jabber-bot-perl-2.1.5/META.yml 2009-08-24 16:05:12.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/META.yml 2020-11-15 21:07:00.000000000 +0000 @@ -1,45 +1,43 @@ ---- #YAML:1.0 -name: Net-Jabber-Bot -version: 2.1.5 -abstract: Automated Bot creation with safeties +--- +abstract: 'Automated Bot creation with safeties' author: - - Todd E Rinaldo -license: perl -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'Todd E Rinaldo ' build_requires: - ExtUtils::MakeMaker: 0 - FindBin: 0 - lib: 0 - Test::More: 0 - Test::NoWarnings: 0 + ExtUtils::MakeMaker: '0' + FindBin: '0' + Test::More: '0' + Test::NoWarnings: '0' + lib: '0' +configure_requires: + ExtUtils::MakeMaker: '0' +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: '1.4' +name: Net-Jabber-Bot +no_index: + directory: + - t + - inc requires: - FindBin: 0 - lib: 0 - Log::Log4perl: 0 - Moose: 0.82 - MooseX::Types: 0.12 - Net::Jabber: 2 - Sys::Hostname: 0 - Test::More: 0 - Test::NoWarnings: 0 - Time::HiRes: 0 - version: 0 + FindBin: '0' + Log::Log4perl: '0' + Moose: '0.82' + MooseX::Types: '0.12' + Mozilla::CA: '0' + Net::Jabber: '2' + Sys::Hostname: '0' + Test::More: '0' + Test::NoWarnings: '0' + Time::HiRes: '0' + lib: '0' + version: '0' resources: - bugtracker: http://code.google.com/p/perl-net-jabber-bot/issues/list - homepage: http://wiki.github.com/toddr/perl-net-jabber-bot - license: http://dev.perl.org/licenses/ - MailingList: http://groups.google.com/group/perl-net-jabber-bot - repository: http://github.com/toddr/perl-net-jabber-bot/tree/master -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.54 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 -recommends: - Test::Pod: 1.14 - Test::Pod::Coverage: 1.04 + bugtracker: https://github.com/toddr/perl-net-jabber-bot/issues + homepage: http://wiki.github.com/toddr/perl-net-jabber-bot + license: http://dev.perl.org/licenses/ + repository: http://github.com/toddr/perl-net-jabber-bot/tree/master +version: v2.1.7 +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libnet-jabber-bot-perl-2.1.5/README libnet-jabber-bot-perl-2.1.7/README --- libnet-jabber-bot-perl-2.1.5/README 2009-08-24 15:56:46.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -Net-Jabber-Bot - -This is the readme on how to install Jabber Bot - -Pre-Reqs - -Moose -Net::Jabber - -INSTALLATION - -To install this module, run the following commands: - - perl Makefile.PL - make - make test - make install - - -SUPPORT AND DOCUMENTATION - -After installing, you can find documentation for this module with the perldoc command. - - perldoc Net::Jabber::Bot - -You can also look for information at: - - Search CPAN - http://search.cpan.org/dist/Net-Jabber-Bot - - AnnoCPAN, annotated CPAN documentation: - http://annocpan.org/dist/Net-Jabber-Bot - - CPAN Ratings: - http://cpanratings.perl.org/d/Net-Jabber-Bot - - Google Request Tracker: - http://code.google.com/p/perl-net-jabber-bot/issues/entry - - Google SVN Repository: - http://code.google.com/p/perl-net-jabber-bot - -COPYRIGHT AND LICENCE - -Copyright (C) 2007 Todd E Rinaldo - -This program is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. diff -Nru libnet-jabber-bot-perl-2.1.5/README.md libnet-jabber-bot-perl-2.1.7/README.md --- libnet-jabber-bot-perl-2.1.5/README.md 1970-01-01 00:00:00.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/README.md 2020-01-18 19:28:18.000000000 +0000 @@ -0,0 +1,376 @@ +[![](https://github.com/toddr/perl-net-jabber-bot/workflows/linux/badge.svg)](https://github.com/toddr/perl-net-jabber-bot/actions) [![](https://github.com/toddr/perl-net-jabber-bot/workflows/macos/badge.svg)](https://github.com/toddr/perl-net-jabber-bot/actions) [![](https://github.com/toddr/perl-net-jabber-bot/workflows/windows/badge.svg)](https://github.com/toddr/perl-net-jabber-bot/actions) + +# NAME + +Net::Jabber::Bot - Automated Bot creation with safeties + +# VERSION + +Version 2.1.6 + +# SYNOPSIS + +Program design: +This is a Moose based Class. + +The idea behind the module is that someone creating a bot should not really have to know a whole lot about how the Jabber protocol works in order to use it. It also allows us to abstract away all the things that can get a bot maker into trouble. Essentially the object helps protect the coders from their own mistakes. + +All someone should have to know and define in the program away from the object is: + +- 1. Config - Where to connect, how often to do things, timers, etc +- 2. A subroutine to be called by the bot object when a new message comes in. +- 3. A subroutine to be called by the bot object every so often that lets the user do background activities (check logs, monitor web pages, etc.), + +The object at present has the following enforced safeties as long as you do not override safety mode: + +- 1. Limits messages per second, configurable at start up, (Max is 5 per second) by requiring a sleep timer in the message sending subroutine each time one is sent. +- 2. Endless loops of responding to self prevented by now allowing the bot message processing subroutine to know about messages from self +- 3. Forum join grace period to prevent bot from reacting to historical messages +- 4. Configurable aliases the bot will respond to per forum +- 5. Limits maximum message size, preventing messages that are too large from being sent (largest configurable message size limit is 1000). +- 6. Automatic chunking of messages to split up large messages in message sending subroutine +- 7. Limit on messages per hour. (max configurable limit of 125) Messages are visible via log4perl, but not ever be sent once the message limit is reached for that hour. + +# FUNCTIONS + +- **new** + + Minimal: + + my $bot = Net::Jabber::Bot->new( + server => 'host.domain.com', # Name of server when sending messages internally. + conference_server => 'conference.host.domain.com', + port => 522, + username => 'username', + password => 'pasword', + safety_mode => 1, + message_function => \&new_bot_message, + background_function => \&background_checks, + forums_and_responses => \%forum_list + ); + + All options: + + my $bot = Net::Jabber::Bot->new( + server => 'host.domain.com', # Name of server when sending messages internally. + conference_server => 'conference.host.domain.com', + server_host => 'talk.domain.com', # used to specify what jabber server to connect to on connect? + tls => 0, # set to 1 for google + ssl_ca_path => '', # path to your CA cert bundle + ssl_verify => 0, # for testing and for self-signed certificates + connection_type => 'tcpip', + port => 522, + username => 'username', + password => 'pasword', + alias => 'cpan_bot', + message_function => \&new_bot_message, + background_function => \&background_checks, + loop_sleep_time => 15, + process_timeout => 5, + forums_and_responses => \%forum_list, + ignore_server_messages => 1, + ignore_self_messages => 1, + out_messages_per_second => 4, + max_message_size => 1000, + max_messages_per_hour => 100 + ); + + Set up the object and connect to the server. Hash values are passed to new as a hash. + + The following initialization variables can be passed. Only marked variables are required (TODO) + + - **safety\_mode** + + safety_mode = (1,0) + + Determines if the bot safety features are turned on and enforced. This mode is on by default. Many of the safety features are here to assure you do not crash your favorite jabber server with floods, etc. DO NOT turn it off unless you're sure you know what you're doing (not just Sledge Hammer ceratin) + + - **server** + + Jabber server name + + - **server\_host** + + Defaults to the same value set for 'server' above. + This is where the bot initially connects. For google for instance, you should set this to 'gmail.com' + + - **conference\_server** + + conferencee server (usually conference.$server\_name) + + - **port** + + Defaults to 5222 + + - **tls** + + Boolean value. defaults to 0. for google, it is know that this value must be 1 to work. + + - **ssl\_ca\_path** + + The path to your CA cert bundle. This is passed on to XML::Stream eventually. + + - **ssl\_verify** + + Enable or disable server certificate validity check when connecting to server. This is passed on to XML::Stream eventually. + + - **connection\_type** + + defaults to 'tcpip' also takes 'http' + + - **username** + + The user you authenticate with to access the server. Not full name, just the stuff to the left of the @... + + - **password** + + password to get into the server + + - **alias** + + This will be your nickname in rooms, as well as the login resource (which can't have duplicates). I couldn't come up with any reason these should not be the same so hardcoded them to be the same. + + - **forums\_and\_responses** + + A hash ref which lists the forum names to join as the keys and the values are an array reference to a list of strings they are supposed to be responsive to. + The array is order sensitive and an empty string means it is going to respond to all messages in this forum. Make sure you list this last. + + The found 'response string' is assumed to be at the beginning of the message. The message\_funtion function will be called with the modified string. + + alias = jbot:, attention: + + example1: + + message: 'jbot: help' + + passed to callback: 'help' + + - **message\_function** + + The subroutine the bot will call when a new message is recieved by the bot. Only called if the bot's logic decides it's something you need to know about. + + - **background\_function** + + The subroutine the bot will call when every so often (loop\_sleep\_time) to allow you to do background activities outside jabber stuff (check logs, web pages, etc.) + + - **loop\_sleep\_time** + + Frequency background function is called. + + - **process\_timeout** + + Time Process() will wait if no new activity is received from the server + + - **ignore\_server\_messages** + + Boolean value as to whether we should ignore messages sent to us from the jabber server (addresses can be a little cryptic and hard to process) + + - **ignore\_self\_messages** + + Boolean value as to whether we should ignore messages sent by us. + + BE CAREFUL if you turn this on!!! Turning this on risks potentially endless loops. If you're going to do this, please be sure safety is turned on at least initially. + + - **out\_messages\_per\_second** + + Limits the number of messages per second. Number must be <gt> 0 + + default: 5 + + safety: 5 + + - **max\_message\_size** + + Specify maximimum size a message can be before it's split and sent in pieces. + + default: 1,000,000 + + safety: 1,000 + + - **max\_messages\_per\_hour** + + Limits the number of messages per hour before we refuse to send them + + default: 125 + + safety: 166 + +- **JoinForum** + + Joins a jabber forum and sleeps safety time. Also prevents the object + from responding to messages for a grace period in efforts to get it to + not respond to historical messages. This has failed sometimes. + + NOTE: No error detection for join failure is present at the moment. (TODO) + +- **Process** + + Mostly calls it's client connection's "Process" call. + Also assures a timeout is enforced if not fed to the subroutine + You really should not have to call this very often. + You should mostly be calling Start() and just let the Bot kernel handle all this. + +- **Start** + + Primary subroutine save new called by the program. Does an endless loop of: + + - 1. Process + - 2. If Process failed, Reconnect to server over larger and larger timeout + - 3. run background process fed from new, telling it who I am and how many loops we have been through. + - 4. Enforce a sleep to prevent server floods. + +- **ReconnectToServer** + + You should not ever need to use this. the Start() kernel usually figures this out and calls it. + + Internal process: + + 1. Disconnects + 3. Re-initializes + +- **Disconnect** + + Disconnects from server if client object is defined. Assures the client object is deleted. + +- **IsConnected** + + Reports connect state (true/false) based on the status of client\_start\_time. + +- **\_process\_jabber\_message** - DO NOT CALL + + Handles incoming messages. + +- **get\_responses** + + $bot->get_ident($forum_name); + + Returns the array of messages we are monitoring for in supplied forum or replies with undef. + +- **\_jabber\_in\_iq\_message** - DO NOT CALL + + Called when the client receives new messages during Process of this type. + +- **\_jabber\_presence\_message** - DO NOT CALL + + Called when the client receives new presence messages during Process. + Mostly we are just pushing the data down into the client DB for later processing. + +- **respond\_to\_self\_messages** + + $bot->respond_to_self_messages($value = 1); + + Tells the bot to start reacting to it\\'s own messages if non-zero is passed. Default is 1. + +- **get\_messages\_this\_hour** + + $bot->get_messages_this_hour(); + + replys with number of messages sent so far this hour. + +- **get\_safety\_mode** + + Validates that we are in safety mode. Returns a bool as long as we are an object, otherwise returns undef + +- **SendGroupMessage** + + $bot->SendGroupMessage($name, $message); + + Tells the bot to send a message to the recipient room name + +- **SendPersonalMessage** + + $bot->SendPersonalMessage($recipient, $message); + + How to send an individual message to someone. + + $recipient must read as user@server/Resource or it will not send. + +- **SendJabberMessage** + + $bot->SendJabberMessage($recipient, $message, $message_type, $subject); + + The master subroutine to send a message. Called either by the user, SendPersonalMessage, or SendGroupMessage. Sometimes there + is call to call it directly when you do not feel like figuring you messaged you. + Assures message size does not exceed a limit and chops it into pieces if need be. + + NOTE: non-printable characters (unicode included) will be stripped before sending to the server via: + s/\[^\[:print:\]\]+/./xmsg + +- **SetForumSubject** + + $bot->SetForumSubject($recipient, $subject); + + Sets the subject of a forum + +- **ChangeStatus** + + $bot->ChangeStatus($presence_mode, $status_string); + + Sets the Bot's presence status. + $presence mode could be something like: (Chat, Available, Away, Ext. Away, Do Not Disturb). + $status\_string is an optional comment to go with your presence mode. It is not required. + +- **GetRoster** + + $bot->GetRoster(); + + Returns a list of the people logged into the server. + I suspect we really want to know who is in a paticular forum right? + In which case we need another sub for this. + +- **GetStatus** + + Need documentation from Yago on this sub. + +- **AddUser** + + Need documentation from Yago on this sub. + +- **RmUser** + + Need documentation from Yago on this sub. + +# AUTHOR + +Todd Rinaldo `` + +# BUGS + +Please report any bugs or feature requests to +`perl-net-jabber-bot@googlegroups.com`, or through the web interface at +[http://code.google.com/p/perl-net-jabber-bot/issues/entry](http://code.google.com/p/perl-net-jabber-bot/issues/entry). +I will be notified, and then you'll automatically be notified of progress on +your bug as I make changes. + +# SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc Net::Jabber::Bot + +You can also look for information at: + +- AnnoCPAN: Annotated CPAN documentation + + [http://annocpan.org/dist/Net-Jabber-Bot](http://annocpan.org/dist/Net-Jabber-Bot) + +- CPAN Ratings + + [http://cpanratings.perl.org/d/Net-Jabber-Bot](http://cpanratings.perl.org/d/Net-Jabber-Bot) + +- Metacpan + + [https://metacpan.org/pod/Net::Jabber::Bot](https://metacpan.org/pod/Net::Jabber::Bot) + +- Github + + [https://github.com/toddr/perl-net-jabber-bot](https://github.com/toddr/perl-net-jabber-bot) + +# ACKNOWLEDGEMENTS + +# COPYRIGHT & LICENSE + +Copyright 2007 Todd E Rinaldo, all rights reserved. + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. diff -Nru libnet-jabber-bot-perl-2.1.5/t/03-test_connectivity.t libnet-jabber-bot-perl-2.1.7/t/03-test_connectivity.t --- libnet-jabber-bot-perl-2.1.5/t/03-test_connectivity.t 2009-08-24 15:57:35.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/t/03-test_connectivity.t 2020-01-18 06:45:53.000000000 +0000 @@ -4,7 +4,7 @@ use Test::More; # Author tests - requires Config::Std - plan skip_all => "\$ENV{AUTHOR} required for these tests" if(!defined $ENV{AUTHOR}); + plan skip_all => "\$ENV{AUTHOR_TESTING} required for these tests" if(!$ENV{AUTHOR_TESTING}); eval "use Config::Std"; plan skip_all => "Optional Module Config::Std Required for these tests" if($@); } diff -Nru libnet-jabber-bot-perl-2.1.5/t/99-pod-coverage.t libnet-jabber-bot-perl-2.1.7/t/99-pod-coverage.t --- libnet-jabber-bot-perl-2.1.5/t/99-pod-coverage.t 2009-08-24 15:56:46.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/t/99-pod-coverage.t 2020-01-18 07:07:13.000000000 +0000 @@ -2,6 +2,8 @@ use Test::More; +plan skip_all => "\$ENV{RELEASE_TESTING} required for these tests" if(!$ENV{RELEASE_TESTING}); + eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; diff -Nru libnet-jabber-bot-perl-2.1.5/t/99-pod.t libnet-jabber-bot-perl-2.1.7/t/99-pod.t --- libnet-jabber-bot-perl-2.1.5/t/99-pod.t 2009-06-22 20:59:57.000000000 +0000 +++ libnet-jabber-bot-perl-2.1.7/t/99-pod.t 2020-01-18 07:07:24.000000000 +0000 @@ -1,6 +1,10 @@ #!perl -T use Test::More; + +plan skip_all => "\$ENV{RELEASE_TESTING} required for these tests" if(!$ENV{RELEASE_TESTING}); + eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; + all_pod_files_ok();