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 the AnyEvent::XMPP::IM::Connection object, but only if this account already has one. If it doesn't? You get undef. 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 $jid into a nickname πŸ‘‘ Here's how: it looks $jid up 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 the AnyEvent::XMPP::IM::Message object 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_jid to $full_jid. Lowkey the most important event on this page, iykyk πŸ‘€
  • removed β€” whenever the account gets removed from the AnyEvent::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 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