{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP::Roster (perldoc)\n\n## NAME\n\nNet::XMPP::Roster - XMPP Roster Object\n\n## SYNOPSIS\n\nNet::XMPP::Roster is a module that provides a developer an easy interface to an XMPP roster. It\nprovides high level functions to query, update, and manage a user's roster.\n\n## DESCRIPTION\n\nThe Roster object seeks to provide an easy to use API for interfacing with a user's roster. When\nyou instantiate it, it automatically registers with the connection to receivce the correct\npackets so that it can track all roster updates, and presence packets.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (2 subsections)\n- **METHODS** (7 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP::Roster",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP::Roster - XMPP Roster Object",
        "synopsis": "Net::XMPP::Roster is a module that provides a developer an easy interface to an XMPP roster. It\nprovides high level functions to query, update, and manage a user's roster.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "lines": 46
                    },
                    {
                        "name": "Advanced Functions",
                        "lines": 24
                    }
                ]
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "lines": 87
                    },
                    {
                        "name": "Advanced Functions",
                        "lines": 1
                    },
                    {
                        "name": "add",
                        "lines": 4
                    },
                    {
                        "name": "addResource",
                        "lines": 4
                    },
                    {
                        "name": "remove",
                        "lines": 2
                    },
                    {
                        "name": "removeResource",
                        "lines": 2
                    },
                    {
                        "name": "handler",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP::Roster - XMPP Roster Object\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP::Roster is a module that provides a developer an easy interface to an XMPP roster. It\nprovides high level functions to query, update, and manage a user's roster.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Roster object seeks to provide an easy to use API for interfacing with a user's roster. When\nyou instantiate it, it automatically registers with the connection to receivce the correct\npackets so that it can track all roster updates, and presence packets.\n",
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "content": "my $Client = Net::XMPP::Client->new(...);\n\nmy $Roster = Net::XMPP::Roster->new(connection=>$Client);\nor\nmy $Roster = $Client->Roster();\n\n$Roster->clear();\n\nif ($Roster->exists('bob@jabber.org')) { ... }\nif ($Roster->exists(Net::XMPP::JID)) { ... }\n\nif ($Roster->groupExists(\"Friends\")) { ... }\n\nmy @groups = $Roster->groups();\n\nmy @jids    = $Roster->jids();\nmy @friends = $Roster->jids(\"group\",\"Friends\");\nmy @unfiled = $Roster->jids(\"nogroup\");\n\nif ($Roster->online('bob@jabber.org')) { ... }\nif ($Roster->online(Net::XMPP::JID)) { ... }\n\nmy %hash = $Roster->query('bob@jabber.org');\nmy %hash = $Roster->query(Net::XMPP::JID);\n\nmy $name = $Roster->query('bob@jabber.org',\"name\");\nmy $ask  = $Roster->query(Net::XMPP::JID,\"ask\");\n\nmy $resource = $Roster->resource('bob@jabber.org');\nmy $resource = $Roster->resource(Net::XMPP::JID);\n\nmy %hash = $Roster->resourceQuery('bob@jabber.org',\"Home\");\nmy %hash = $Roster->resourceQuery(Net::XMPP::JID,\"Club\");\n\nmy $show   = $Roster->resourceQuery('bob@jabber.org',\"Home\",\"show\");\nmy $status = $Roster->resourceQuery(Net::XMPP::JID,\"Work\",\"status\");\n\nmy @resource = $Roster->resources('bob@jabber.org');\nmy @resource = $Roster->resources(Net::XMPP::JID);\n\n$Roster->resourceStore('bob@jabber.org',\"Home\",\"gpgkey\",key);\n$Roster->resourceStore(Net::XMPP::JID,\"logged on\",\"2004/04/07 ...\");\n\n$Roster->store('bob@jabber.org',\"avatar\",avatar);\n$Roster->store(Net::XMPP::JID,\"displayname\",\"Bob\");\n"
                    },
                    {
                        "name": "Advanced Functions",
                        "content": "These functions are only needed if you want to manually control the Roster.\n\n$Roster->add('bob@jabber.org',\nname=>\"Bob\",\ngroups=>[\"Friends\"]\n);\n$Roster->add(Net::XMPP::JID);\n\n$Roster->addResource('bob@jabber.org',\n\"Home\",\nshow=>\"dnd\",\nstatus=>\"Working\"\n);\n$Roster->addResource(Net::XMPP::JID,\"Work\");\n\n$Roster->remove('bob@jabber.org');\n$Roster->remove(Net::XMPP::JID);\n\n$Roster->removeResource('bob@jabber.org',\"Home\");\n$Roster->removeResource(Net::XMPP::JID,\"Work\");\n\n$Roster->handler(Net::XMPP::IQ);\n$Roster->handler(Net::XMPP::Presence);\n"
                    }
                ]
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Basic Functions",
                        "content": "new\nnew(connection=>object)\n\nThis creates and initializes the Roster object. The connection object is required so that\nthe Roster can interact with the main connection object. It needs to be an object that\ninherits from Net::XMPP::Connection.\n\nclear\nclear()\n\nremoves everything from the database.\n\nexists\nexists(jid)\n\nreturn 1 if the JID exists in the database, undef otherwise. The jid can either be a string,\nor a Net::XMPP::JID object.\n\ngroupExists\ngroupExists(group)\n\nreturn 1 if the group exists in the database, undef otherwise.\n\ngroups\ngroups()\n\nReturns a list of all of the roster groups.\n\njids\njids([type, [group]])\n\nreturns a list of all of the matching JIDs. The valid types are:\n\nall     - return all JIDs in the roster. (default)\nnogroup - return all JIDs not in a roster group.\ngroup   - return all of the JIDs in the specified\nroster group.\n\nonline\nonline(jid)\n\nreturn 1 if the JID is online, undef otherwise. The jid can either be a string, or a\nNet::XMPP::JID object.\n\nquery\nquery(jid, [key])\n\nreturn a hash representing all of the data in the DB for this JID. The jid can either be a\nstring, or a Net::XMPP::JID object. If you specify a key, then only the value for that key\nis returned.\n\nresource\nresource(jid)\n\nreturn the string representing the resource with the highest priority for the JID. The jid\ncan either be a string, or a Net::XMPP::JID object.\n\nresourceQuery\nresourceQuery(jid,\nresource,\n[key])\n\nreturn a hash representing all of the data the DB for the resource for this JID. The jid can\neither be a string, or a Net::XMPP::JID object. If you specify a key, then only the value\nfor that key is returned.\n\nresources\nresources(jid)\n\nreturns the list of resources for the JID in order of highest priority to lowest priority.\nThe jid can either be a string, or a Net::XMPP::JID object.\n\nresourceStore\nresourceStore(jid,\nresource,\nkey,\nvalue)\n\nstore the specified value in the DB under the specified key for the resource for this JID.\nThe jid can either be a string, or a Net::XMPP::JID object.\n\nstore\nstore(jid, key, value)\n\nstore the specified value in the DB under the specified key for this JID. The jid can either\nbe a string, or a Net::XMPP::JID object.\n"
                    },
                    {
                        "name": "Advanced Functions",
                        "content": ""
                    },
                    {
                        "name": "add",
                        "content": "settings. This does not groups=>arrayref handle subscribing to other users, only name=>string,\nmanipulating the Roster object. The jid subscription=>string) can either be a string or a\nNet::XMPP::JID.\n"
                    },
                    {
                        "name": "addResource",
                        "content": "specified presence settings. priority=>int, This does not handle subscribing to other\nshow=>string, users, only manipulating the Roster object. status=>string) The jid can either be\na string or a Net::XMPP::JID.\n"
                    },
                    {
                        "name": "remove",
                        "content": "string or a Net::XMPP::JID.\n"
                    },
                    {
                        "name": "removeResource",
                        "content": "can either be a string or a Net::XMPP::JID.\n"
                    },
                    {
                        "name": "handler",
                        "content": "according to the rules of the Roster object. Note, that it will only waste CPU time if you pass\nin IQs or Presences that are not roster related.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Originally authored by Ryan Eatmon.\n\nPreviously maintained by Eric Hacker.\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.\n",
                "subsections": []
            }
        }
    }
}