| AnyEvent-XMPP documentation | Contained in the AnyEvent-XMPP distribution. |
AnyEvent::XMPP::Ext::MUC::RoomInfo - Room information
This module represents the room information for a MUC.
This method returns the info discovery object AnyEvent::XMPP::Ext::Disco::Info for the disco query that this roominfo was obtained from.
Returns the MUC room information as string for debugging.
Robin Redeker, <elmex at ta-sa.org>, JID: <elmex at jabber.org>
Copyright 2007, 2008 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| AnyEvent-XMPP documentation | Contained in the AnyEvent-XMPP distribution. |
package AnyEvent::XMPP::Ext::MUC::RoomInfo; use strict; use AnyEvent::XMPP::Namespaces qw/xmpp_ns/;
sub new { my $this = shift; my $class = ref($this) || $this; my $self = bless { @_ }, $class; $self->init; $self } sub init { my ($self) = @_; my $info = $self->{disco_info}; my $df; if (my ($xdata) = $info->xml_node ()->find_all ([qw/data_form x/])) { $df = AnyEvent::XMPP::Ext::DataForm->new; $df->from_node ($xdata); } $self->{form} = $df; }
sub disco_info { $_[0]->{disco_info} }
sub as_debug_string { my ($self) = @_; my $info = $self->{disco_info}; my @feats = keys %{$info->features}; my $str = "MUC features for " . $info->jid . "\n"; for (@feats) { if (/^muc_/) { $str .= "- $_\n"; } } if (defined $self->{form}) { $str .= "form:\n"; $str .= $self->{form}->as_debug_string; } $str }
1;