{
    "mode": "perldoc",
    "parameter": "Net::Jabber::Dialback::Result",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AJabber%3A%3ADialback%3A%3AResult/json",
    "generated": "2026-10-09T12:19:56Z",
    "synopsis": "Net::Jabber::Dialback::Result is a companion to the Net::Jabber::Dialback\nmodule.  It provides the user a simple interface to set and retrieve all\nparts of a Jabber Dialback Result.",
    "sections": {
        "NAME": {
            "content": "Net::Jabber::Dialback::Result - Jabber Dialback Result Module\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Net::Jabber::Dialback::Result is a companion to the Net::Jabber::Dialback\nmodule.  It provides the user a simple interface to set and retrieve all\nparts of a Jabber Dialback Result.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "To initialize the Result with a Jabber <db:*/> you must pass it\nthe XML::Stream hash.  For example:\n\nmy $dialback = new Net::Jabber::Dialback::Result(%hash);\n\nThere has been a change from the old way of handling the callbacks.\nYou no longer have to do the above yourself, a NJ::Dialback::Result\nobject is passed to the callback function for the message.  Also,\nthe first argument to the callback functions is the session ID from\nXML::Streams.  There are some cases where you might want this\ninformation, like if you created a Client that connects to two servers\nat once, or for writing a mini server.\n\nuse Net::Jabber qw(Server);\n\nsub dialbackResult {\nmy ($sid,$Result) = @;\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new dialback to send to the server:\n\nuse Net::Jabber qw(Server);\n\n$Result = new Net::Jabber::Dialback::Result();\n\nNow you can call the creation functions below to populate the tag before\nsending it.\n\nFor more information about the array format being passed to the CallBack\nplease read the Net::Jabber::Client documentation.\n",
            "subsections": [
                {
                    "name": "Retrieval functions",
                    "content": "$to         = $Result->GetTo();\n$from       = $Result->GetFrom();\n$type       = $Result->GetType();\n\n$data       = $Result->GetData();\n\n$str        = $Result->GetXML();\n@dialback   = $Result->GetTree();\n"
                },
                {
                    "name": "Creation functions",
                    "content": "$Result->SetResult(from=>\"jabber.org\",\nto=>\"jabber.com\",\ndata=>key);\n$Result->SetTo(\"jabber.org\");\n$Result->SetFrom(\"jabber.com\");\n$Result->SetType(\"valid\");\n$Result->SetData(key);\n"
                },
                {
                    "name": "Test functions",
                    "content": "$test = $Result->DefinedTo();\n$test = $Result->DefinedFrom();\n$test = $Result->DefinedType();\n"
                }
            ]
        },
        "METHODS": {
            "content": "",
            "subsections": [
                {
                    "name": "Retrieval functions",
                    "content": "GetTo() -  returns a string with server that the <db:result/> is being\nsent to.\n\nGetFrom() -  returns a string with server that the <db:result/> is being\nsent from.\n\nGetType() - returns a string with the type <db:result/> this is.\n\nGetData() - returns a string with the cdata of the <db:result/>.\n\nGetXML() - returns the XML string that represents the <db:result/>.\nThis is used by the Send() function in Server.pm to send\nthis object as a Jabber Dialback Result.\n\nGetTree() - returns an array that contains the <db:result/> tag\nin XML::Parser::Tree format.\n"
                },
                {
                    "name": "Creation functions",
                    "content": "SetResult(to=>string,   - set multiple fields in the <db:result/>\nfrom=>string,   at one time.  This is a cumulative\ntype=>string,   and over writing action.  If you set\ndata=>string)   the \"from\" attribute twice, the second\nsetting is what is used.  If you set\nthe type, and then set the data\nthen both will be in the <db:result/>\ntag.  For valid settings read the\nspecific Set functions below.\n\nSetTo(string) - sets the to attribute.\n\nSetFrom(string) - sets the from attribute.\n\nSetType(string) - sets the type attribute.  Valid settings are:\n\nvalid\ninvalid\n\nSetData(string) - sets the cdata of the <db:result/>.\n"
                },
                {
                    "name": "Test functions",
                    "content": "DefinedTo() - returns 1 if the to attribute is defined in the\n<db:result/>, 0 otherwise.\n\nDefinedFrom() - returns 1 if the from attribute is defined in the\n<db:result/>, 0 otherwise.\n\nDefinedType() - returns 1 if the type attribute is defined in the\n<db:result/>, 0 otherwise.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "By Ryan Eatmon in May of 2001 for http://jabber.org..\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "This module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "Net::Jabber::Dialback::Result - Jabber Dialback Result Module",
    "flags": [],
    "examples": [],
    "see_also": []
}