static void bookmark_load(htsmsg_t *m) { if((m = htsmsg_get_map(m, "model")) == NULL) return; bookmark_add(htsmsg_get_str(m, "title"), htsmsg_get_str(m, "url"), htsmsg_get_str(m, "svctype")); }
/** * Control function for bookmark parent. Here we create / destroy * entries. */ static void bookmarks_callback(void *opaque, prop_event_t event, ...) { va_list ap; va_start(ap, event); switch(event) { default: break; case PROP_REQ_NEW_CHILD: bookmark_add("New bookmark", "none:", "other"); break; case PROP_REQ_DELETE_VECTOR: prop_vec_destroy_entries(va_arg(ap, prop_vec_t *)); break; } }
void sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean config_required, const char *const role, const char *const affiliation, const char *const actor, const char *const reason, const char *const jid, const char *const show, const char *const status) { muc_roster_add(room, nick, jid, role, affiliation, show, status); char *old_role = muc_role_str(room); char *old_affiliation = muc_affiliation_str(room); muc_set_role(room, role); muc_set_affiliation(room, affiliation); // handle self nick change if (muc_nick_change_pending(room)) { muc_nick_change_complete(room, nick); ProfMucWin *mucwin = wins_get_muc(room); if (mucwin) { mucwin_nick_change(mucwin, nick); } // handle roster complete } else if (!muc_roster_complete(room)) { if (muc_autojoin(room)) { ui_room_join(room, FALSE); } else { ui_room_join(room, TRUE); } iq_room_info_request(room, FALSE); if (muc_invites_contain(room)) { if (prefs_get_boolean(PREF_BOOKMARK_INVITE) && !bookmark_exists(room)) { bookmark_add(room, nick, muc_invite_password(room), "on"); } muc_invites_remove(room); } muc_roster_set_complete(room); // show roster if occupants list disabled by default ProfMucWin *mucwin = wins_get_muc(room); if (mucwin && !prefs_get_boolean(PREF_OCCUPANTS)) { GList *occupants = muc_roster(room); mucwin_roster(mucwin, occupants, NULL); g_list_free(occupants); } char *subject = muc_subject(room); if (mucwin && subject) { mucwin_subject(mucwin, NULL, subject); } GList *pending_broadcasts = muc_pending_broadcasts(room); if (mucwin && pending_broadcasts) { GList *curr = pending_broadcasts; while (curr) { mucwin_broadcast(mucwin, curr->data); curr = g_list_next(curr); } } // room configuration required if (config_required) { muc_set_requires_config(room, TRUE); if (mucwin) { mucwin_requires_config(mucwin); } } rosterwin_roster(); // check for change in role/affiliation } else { ProfMucWin *mucwin = wins_get_muc(room); if (mucwin && prefs_get_boolean(PREF_MUC_PRIVILEGES)) { // both changed if ((g_strcmp0(role, old_role) != 0) && (g_strcmp0(affiliation, old_affiliation) != 0)) { mucwin_role_and_affiliation_change(mucwin, role, affiliation, actor, reason); // role changed } else if (g_strcmp0(role, old_role) != 0) { mucwin_role_change(mucwin, role, actor, reason); // affiliation changed } else if (g_strcmp0(affiliation, old_affiliation) != 0) { mucwin_affiliation_change(mucwin, affiliation, actor, reason); } } } occupantswin_occupants(room); }
static void parse_rdf_item (GbBookmarkSet *set, GbFolder *root, GList **folders, xmlNodePtr node) { xmlChar *title = NULL; xmlChar *link = NULL; xmlChar *smartlink = NULL; GList *subjects = NULL, *l; xmlNodePtr child; GbBookmark *bmk; child = node->children; while (child != NULL) { if (xmlStrEqual (child->name, (const xmlChar*)"title")) { title = xmlNodeGetContent (child); } else if (xmlStrEqual (child->name, (const xmlChar*)"link")) { link = xmlNodeGetContent (child); } else if (xmlStrEqual (child->name, (const xmlChar*)"subject")) { parse_rdf_subjects (child, &subjects); } else if (xmlStrEqual (child->name, (const xmlChar*)"smartlink")) { smartlink = xmlNodeGetContent (child); } child = child->next; } bmk = bookmark_add (set, (char*)title, (char*)link, (char*)smartlink); g_return_if_fail (bmk != NULL); for (l = subjects; l != NULL; l = l->next) { const char *title = (char *) l->data; GbFolder *folder; GList *item; item = g_list_find_custom (*folders, title, (GCompareFunc) find_folder); if (item) { folder = GB_FOLDER (item->data); } else { /* create folder from subject */ folder = gb_folder_new (set, title); gb_folder_add_child (root, GB_BOOKMARK (folder), -1); *folders = g_list_prepend (*folders, folder); } gb_bookmark_add_alias_under (bmk, folder); } if (subjects == NULL) { /* "Uncategorised" bookmark, add to root folder */ gb_folder_add_child (root, bmk, -1); } xmlFree (title); xmlFree (link); xmlFree (smartlink); g_list_foreach (subjects, (GFunc) xmlFree, NULL); g_list_free (subjects); }