Example #1
0
void
Ekiga::PresenceCore::on_presentity_added (HeapPtr heap,
					  PresentityPtr presentity,
					  ClusterPtr cluster)
{
  presentity_added (cluster, heap, presentity);
}
Example #2
0
void
RL::Heap::parse_list (xmlNodePtr list)
{
    std::string root_str;
    std::string user_str;
    std::string username_str;
    std::string password_str;
    bool writable = false;

    list_node = list;
    {
        xmlChar* str = xmlNodeGetContent (root);
        if (str != NULL)
            root_str = (const char*)str;
    }
    {
        xmlChar* str = xmlNodeGetContent (user);
        if (str != NULL)
            user_str = (const char*)str;
    }
    {
        xmlChar* str = xmlNodeGetContent (username);
        if (str != NULL)
            username_str = (const char*)str;
    }
    {
        xmlChar* str = xmlNodeGetContent (password);
        if (str != NULL)
            password_str = (const char*)str;
    }
    {
        xmlChar* str = xmlGetProp (node, BAD_CAST "writable");
        if (str != NULL) {

            if (xmlStrEqual (str, BAD_CAST "1"))
                writable = true;
            xmlFree (str);
        }
    }

    boost::shared_ptr<XCAP::Path> path(new XCAP::Path (root_str, "resource-lists",
                                       user_str));
    path->set_credentials (username_str, password_str);
    path = path->build_child ("resource-lists");
    path = path->build_child ("list");

    for (xmlNodePtr child = list->children;
            child != NULL;
            child = child->next)
        if (child->type == XML_ELEMENT_NODE
                && child->name != NULL
                && xmlStrEqual (BAD_CAST ("entry"), child->name)) {

            PresentityPtr presentity(new Presentity (services, path, doc, child, writable));
            std::list<boost::signals2::connection> conns;
            conns.push_back (presentity->updated.connect (boost::bind (boost::ref (presentity_updated), presentity)));
            conns.push_back (presentity->removed.connect (boost::bind(boost::ref (presentity_removed),presentity)));
            conns.push_back (presentity->trigger_reload.connect (boost::bind (&RL::Heap::refresh, this)));
            conns.push_back (presentity->questions.connect (boost::ref (questions)));
            presentities[presentity]=conns;
            presentity_added (presentity);
            continue;
        }
}