{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP::Presence (perldoc)\n\n## NAME\n\nNet::XMPP::Presence - XMPP Presence Module\n\n## SYNOPSIS\n\nNet::XMPP::Presence is a companion to the Net::XMPP module. It provides the user a simple\ninterface to set and retrieve all parts of an XMPP Presence.\n\n## DESCRIPTION\n\nA Net::XMPP::Presence object is passed to the callback function for the message. Also, the first\nargument to the callback functions is the session ID from XML::Streams. There are some cases\nwhere you might want this information, like if you created a Client that connects to two servers\nat once, or for writing a mini server.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (4 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP::Presence",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP::Presence - XMPP Presence Module",
        "synopsis": "Net::XMPP::Presence is a companion to the Net::XMPP module. It provides the user a simple\ninterface to set and retrieve all parts of an XMPP Presence.",
        "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": 24,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "lines": 63
                    },
                    {
                        "name": "Creation functions",
                        "lines": 86
                    },
                    {
                        "name": "Removal functions",
                        "lines": 30
                    },
                    {
                        "name": "Test functions",
                        "lines": 30
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP::Presence - XMPP Presence Module\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP::Presence is a companion to the Net::XMPP module. It provides the user a simple\ninterface to set and retrieve all parts of an XMPP Presence.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "A Net::XMPP::Presence object is passed to the callback function for the message. Also, the first\nargument to the callback functions is the session ID from XML::Streams. There are some cases\nwhere you might want this information, like if you created a Client that connects to two servers\nat once, or for writing a mini server.\n\nuse Net::XMPP;\n\nsub presence {\nmy ($sid,$Pres) = @;\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new presence to send to the server:\n\nuse Net::XMPP;\n\n$Pres = Net::XMPP::Presence->new();\n\nNow you can call the creation functions below to populate the tag before sending it.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "content": "GetTo\nGetTo()\n\nreturns the value in the to='' attribute for the <presence/>.\n\nGetTo(\"jid\")\n\nIf you specify \"jid\" as an argument then a Net::XMPP::JID object is returned and you can\neasily parse the parts of the JID.\n\n$to    = $Pres->GetTo();\n$toJID = $Pres->GetTo(\"jid\");\n\nGetFrom\nGetFrom()\n\nreturns the value in the from='' attribute for the <presence/>.\n\nGetFrom(\"jid\")\n\nIf you specify \"jid\" as an argument then a Net::XMPP::JID object is returned and you can\neasily parse the parts of the JID.\n\n$from    = $Pres->GetFrom();\n$fromJID = $Pres->GetFrom(\"jid\");\n\nGetType\nGetType()\n\nreturns the type='' attribute of the <presence/>. Each presence is one of seven types:\n\navailable       available to receive messages; default\nunavailable     unavailable to receive anything\nsubscribe       ask the recipient to subscribe you\nsubscribed      tell the sender they are subscribed\nunsubscribe     ask the recipient to unsubscribe you\nunsubscribed    tell the sender they are unsubscribed\nprobe           probe\n\n$type = $Pres->GetType();\n\nGetStatus\nGetStatus()\n\nreturns a string with the current status of the resource.\n\n$status = $Pres->GetStatus();\n\nGetPriority\nGetPriority()\n\nreturns an integer with the priority of the resource The default is 0 if there is no\npriority in this presence.\n\n$priority = $Pres->GetPriority();\n\nGetShow\nGetShow()\n\nReturns a string with the state the client should show.\n\n$show = $Pres->GetShow();\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "SetPresence\nSetPresence(to=>string|JID\nfrom=>string|JID,\ntype=>string,\nstatus=>string,\npriority=>integer,\nmeta=>string,\nicon=>string,\nshow=>string,\nloc=>string)\n\nset multiple fields in the <presence/> at one time. This is a cumulative and over writing\naction. If you set the \"to\" attribute twice, the second setting is what is used. If you set\nthe status, and then set the priority then both will be in the <presence/> tag. For valid\nsettings read the specific Set functions below.\n\n$Pres->SetPresence(TYPE=>\"away\", StatuS=>\"Out for lunch\");\n\nSetTo\nSetTo(string)\nSetTo(JID)\n\nsets the to attribute. You can either pass a string or a JID object. They must be valid JIDs\nor the server will return an error message. (ie. bob@jabber.org/Silent Bob, etc...)\n\n$Pres->SetTo(\"bob\\@jabber.org\");\n\nSetFrom\nSetFrom(string)\n\nsets the from='' attribute. You can either pass\n\nSetFrom(JID)\n\nA string or a JID object. They must be valid JIDs or the server will return an error\nmessage. (ie. jabber:bob@jabber.org/Work) This field is not required if you are writing a\nClient since the server will put the JID of your connection in there to prevent spamming.\n\n$Pres->SetFrom(\"jojo\\@jabber.org\");\n\nSetType\nSetType(string)\n\nsets the type attribute. Valid settings are:\n\navailable      available to receive messages; default\nunavailable    unavailable to receive anything\nsubscribe      ask the recipient to subscribe you\nsubscribed     tell the sender they are subscribed\nunsubscribe    ask the recipient to unsubscribe you\nunsubscribed   tell the sender they are unsubscribed\nprobe          probe\n\n$Pres->SetType(\"unavailable\");\n\nSetStatus\nSetStatus(string)\n\nsets the status tag to be whatever string the user wants associated with that resource.\n\n$Pres->SetStatus(\"Taking a nap\");\n\nSetPriority\nSetPriority(integer)\n\nsets the priority of this resource. The highest resource attached to the xmpp account is the\none that receives the messages.\n\n$Pres->SetPriority(10);\n\nSetShow\nSetShow(string)\n\nSets the name of the icon or string to display for this resource.\n\n$Pres->SetShow(\"away\");\n\nReply\nReply(hash)\n\ncreates a new Presence object and populates the to/from fields. If you specify a hash the\nsame as with SetPresence then those values will override the Reply values.\n\n$Reply = $Pres->Reply();\n$Reply = $Pres->Reply(type=>\"subscribed\");\n"
                    },
                    {
                        "name": "Removal functions",
                        "content": "RemoveTo\nremoves the to attribute from the <presence/>.\n\n$Pres->RemoveTo();\n\nRemoveFrom\nremoves the from attribute from the <presence/>.\n\n$Pres->RemoveFrom();\n\nRemoveType\nremoves the type attribute from the <presence/>.\n\n$Pres->RemoveType();\n\nRemoveStatus\nremoves the <status/> element from the <presence/>.\n\n$Pres->RemoveStatus();\n\nRemovePriority\nremoves the <priority/> element from the <presence/>.\n\n$Pres->RemovePriority();\n\nRemoveShow\nremoves the <show/> element from the <presence/>.\n\n$Pres->RemoveShow();\n"
                    },
                    {
                        "name": "Test functions",
                        "content": "DefinedTo\nreturns 1 if the to attribute is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedTo();\n\nDefinedFrom\nreturns 1 if the from attribute is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedFrom();\n\nDefinedType\nreturns 1 if the type attribute is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedType();\n\nDefinedStatus\nreturns 1 if <status/> is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedStatus();\n\nDefinedPriority\nreturns 1 if <priority/> is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedPriority();\n\nDefinedShow\nreturns 1 if <show/> is defined in the <presence/>, 0 otherwise.\n\n$test = $Pres->DefinedShow();\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": []
            }
        }
    }
}