Changeset 9d2f010 for perl/modules/Jabber
- Timestamp:
- Feb 18, 2008, 8:54:45 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 2f69081, 61abb18
- Parents:
- b4fcc06 (diff), 6b580b0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- perl/modules/Jabber/lib/BarnOwl/Module
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r879e7e94 r6b580b0 116 116 BarnOwl::error("Connection for $jid undefined -- error in reload?"); 117 117 } 118 118 # We keep this in the mainloop hook for keep-alives 119 119 my $status = $client->Process(0); 120 120 if ( !defined($status) ) { … … 124 124 if ($::shutdown) { 125 125 do_logout($jid); 126 return; 127 } 126 next; 127 } 128 128 129 if ($vars{status_changed}) { 129 130 my $p = new Net::Jabber::Presence; … … 387 388 $conn->renameConnection($jidStr, $fullJid); 388 389 queue_admin_msg("Connected to jabber as $fullJid"); 390 # The remove_dispatch() method is called from the 391 # ConnectionManager's removeConnection() method. 392 $client->{fileno} = $client->getSocket()->fileno(); 393 #queue_admin_msg("Connected to jabber as $fullJid ($client->{fileno})"); 394 BarnOwl::add_dispatch($client->{fileno}, sub { $client->OwlProcess() }); 389 395 } 390 396 } -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber/Connection.pm
r892568b r6b580b0 110 110 111 111 112 =head2 getSID 113 114 Returns the StreamID for this connection. 115 116 =cut 117 118 sub getStreamID { 119 my $self = shift; 120 return $self->{SESSION}->{id} || ""; 121 } 122 123 =head2 getSocket 124 125 Returns the IO::Socket for this connection. 126 127 =cut 128 129 sub getSocket { 130 my $self = shift; 131 my $sid = getStreamID($self); 132 return $self->{STREAM}->GetSock($sid) || -1; 133 } 134 135 =head2 OwlProcess 136 137 Non-blocking connection processing. For use in a select loop. 138 139 =cut 140 141 sub OwlProcess { 142 my $self = shift; 143 my $status = $self->Process(0); 144 if ( !defined($status) ) { 145 my $jid = $self->{SESSION}->{FULLJID}; 146 BarnOwl::error("Jabber account $jid disconnected!"); 147 BarnOwl::Module::Jabber::do_logout($jid); 148 } 149 } 150 112 151 =head1 SEE ALSO 113 152 -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber/ConnectionManager.pm
r7f33c18 r6b580b0 37 37 return 0 unless exists $self->{$jidStr}; 38 38 39 BarnOwl::remove_dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno}; 39 40 $self->{$jidStr}->{Client}->Disconnect() 40 41 if $self->{$jidStr}->{Client}; … … 51 52 return 0 if $oldJidStr eq $newJidStr; 52 53 53 $self->{$newJidStr} = $self->{$oldJidStr}; 54 $self->{$newJidStr} = $self->{$oldJidStr}; 54 55 delete $self->{$oldJidStr}; 55 56 return 1;
Note: See TracChangeset
for help on using the changeset viewer.