DJabberd-MUC Fix (was Releasing 0.84)
Jeremy Lawler
jeremylawler at gmail.com
Thu Jul 31 18:11:40 UTC 2008
> diff --git a/lib/DJabberd/Connection/ClientIn.pm
> b/lib/DJabberd/Connection/ClientIn.pm
> index 3942977..3c2d830 100644
> --- a/lib/DJabberd/Connection/ClientIn.pm
> +++ b/lib/DJabberd/Connection/ClientIn.pm
> @@ -143,6 +143,13 @@ sub close {
> If you disconnect quite unexpectedly, you will not appear as
> disconnected on muc room.
My approach to the same problem:
DJabberd-MUC/lib/DJabberd/Plugin/MUC.pm
29a30,37
> my ($self, $vhost) = @_;
> $vhost->register_hook("ConnectionClosing", sub {
> my (undef, $cb, $conn) = @_;
> my $bj = $conn->bound_jid;
> foreach my $room_name(keys %{$self->{rooms}}){
> $self->{rooms}->{$room_name}->disconnect_jid($bj);
> }
> });
DJabberd-MUC/lib/DJabberd/Plugin/MUC/Room.pm
17a18,22
> sub disconnect_jid {
> my ($self, $jid)=@_;
> $self->remove($self->{jid2nick}->{lc($jid)},lc($jid));
> }
Any opinions on which is the better approach? I went my way because I
figured that was why the ConnectionClosing hook was for...
More information about the Djabberd
mailing list