Codebase list sendxmpp / e752831
Import Upstream version 1.14 Thadeu Lima de Souza Cascardo 6 years ago
1 changed file(s) with 16 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1515 #
1616 # Released under the terms of the GNU General Public License v2
1717 #
18 # $Platon: sendxmpp/sendxmpp,v 1.13 2007-09-10 19:08:35 rajo Exp $
18 # $Platon: sendxmpp/sendxmpp,v 1.14 2008-08-25 09:54:12 rajo Exp $
1919 # $Id: $
2020
2121 use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed
4343 sub main();
4444
4545 my # MakeMaker
46 $VERSION = [ q$Revision: 1.13 $ =~ m/(\S+)\s*$/g ]->[0];
46 $VERSION = [ q$Revision: 1.14 $ =~ m/(\S+)\s*$/g ]->[0];
4747 my $RESOURCE = 'sendxmpp';
4848 my $VERBOSE = 0;
4949 my $DEBUG = 0;
147147
148148 #s/\#.*$//; # ignore comments in lines
149149
150 # Hugo van der Kooij <hvdkooij AT vanderkooij.org> has ccount with '#' as username
151 if (/([\.\w_#-]+)@([-\.\w:]+)\s+(\S+)\s*(\S+)?$/) {
150 # Hugo van der Kooij <hvdkooij AT vanderkooij.org> has account with '#' as username
151 if (/([\.\w_#-]+)@([-\.\w:;]+)\s+(\S+)\s*(\S+)?$/) {
152152 %config = (
153153 'username' => $1,
154154 'jserver' => $2,
157157 'component' => $4,
158158 );
159159
160 if ($config{'jserver'} =~ /(.*):(\d+)/) {
161 $config{'jserver'} = $1;
162 $config{'port'} = $2;
163 }
164160 }
165161 else {
166162 close CFG;
167163 error_exit ("syntax error in line $line of $cfg_file");
164 }
165
166 # account with weird port number
167 if ($config{'jserver'} =~ /(.*):(\d+)/) {
168 $config{'jserver'} = $1;
169 $config{'port'} = $2;
170 }
171
172 # account with specific connection host
173 if ($config{'jserver'} =~ /(.*);([-\.\w]+)/) {
174 $config{'jserver'} = $2;
175 $config{'username'} .= "\@$1";
168176 }
169177 }
170178