AnyEven...:Account(3)
π AnyEvent::XMPP::IM::Account β the IM account class, bestie
So this is a page from the AnyEven...:Account(3) manpage (Perl's own docs, user-contributed section) and honestly? It's a little gem. Let's get into it π
β¨ SYNOPSIS β¨
my $cl = AnyEvent::XMPP::IM::Client->new;
...
my $acc = $cl->get_account ($jid);
That's the whole vibe: make a client, then grab an account off it. Iconic, minimal, no notes π
π DESCRIPTION π
Okay so real talk: this module is the class that represents IM accounts. It does what it says on the tin π«Ά
And here's the thing you need to know β you can't just go AnyEvent::XMPP::IM::Account->new and start living your best life. Nope. The only way to get an instance of this class is by calling the get_account method on an AnyEvent::XMPP::Client object. That's the door. There is no other door. Fr fr πͺβ¨
πΈ METHODS πΈ
connection ()β hands you theAnyEvent::XMPP::IM::Connectionobject, but only if this account already has one. If it doesn't? You getundef. Sorry bestie πis_connected ()β returns true if this account is connected. That's it. That's the whole method. (And yes, the original page spells it "accunt" β we're keeping that typo alive because it's part of the lore π)jid ()β if the account is connected you get the full JID; if it's not connected you get the bare JID. Situational, but slay πbare_jid ()β always gives you the bare JID of this account, and it's already had stringprep applied β¨ which is exactly why you can safely compare the JIDs that come back from this function. Comparison-ready, no cap.nickname ()β your nickname for this account. Cute, personal, yours πnickname_for_jid ($jid)β this one transforms$jidinto a nickname π Here's how: it looks$jidup in the roster and hunts for a nickname there. And if no nickname could be found in the roster? It just returns the node part of the$jid. Fallback queen behavior, honestly.send_tracked_message ($msg)β sends theAnyEvent::XMPP::IM::Messageobject that lives in$msgπ But heads up: the"to"attribute of the message gets adjusted by the conversation tracking mechanism. Not you adjusting it β the mechanism. Let it cook π₯
π¦ EVENTS π¦
For these events you can register callbacks (using the Object::Event interface) β go off, set those listeners π
tracked_message_destination => $bare_jid, $full_jidβ this event fires whenever the message tracking mechanism changes (or sets) its destination resource for$bare_jidto$full_jid. Lowkey the most important event on this page, iykyk πremovedβ whenever the account gets removed from theAnyEvent::XMPP::Client(like, say, when it's disconnected), this event is emitted. Timing detail that matters: it's emitted before the account is destroyed. Say your goodbyes first π₯²π
β AUTHOR β
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>" β the icon, the legend π
π COPYRIGHT & LICENSE π
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. Periodt π
Heads up: the copyright covers 2007 and 2008, and the license terms are "same as Perl itself" β that's the actual legal vibe, not a summary. Keep it in mind π§
and that's the page!! π¦ This was perl v5.42.2, dated 2026-02-15 β thanks for reading with me bestie, mwah ππβ¨
π¦ where this page comes from
- alpine 3.24: perl-anyevent-xmpp-doc 0.55-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms