这篇教程C++ xmpp_send函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xmpp_send函数的典型用法代码示例。如果您正苦于以下问题:C++ xmpp_send函数的具体用法?C++ xmpp_send怎么用?C++ xmpp_send使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xmpp_send函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: message_send_chat_pgpchar*message_send_chat_pgp(const char *const barejid, const char *const msg){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); char *state = _session_state(barejid); char *jid = _session_jid(barejid); char *id = create_unique_id("msg"); xmpp_stanza_t *message = NULL;#ifdef HAVE_LIBGPGME char *account_name = jabber_get_account_name(); ProfAccount *account = accounts_get_account(account_name); if (account->pgp_keyid) { Jid *jidp = jid_create(jid); char *encrypted = p_gpg_encrypt(jidp->barejid, msg); if (encrypted) { message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, "This message is encrypted."); xmpp_stanza_t *x = xmpp_stanza_new(ctx); xmpp_stanza_set_name(x, STANZA_NAME_X); xmpp_stanza_set_ns(x, STANZA_NS_ENCRYPTED); xmpp_stanza_t *enc_st = xmpp_stanza_new(ctx); xmpp_stanza_set_text(enc_st, encrypted); xmpp_stanza_add_child(x, enc_st); xmpp_stanza_release(enc_st); xmpp_stanza_add_child(message, x); xmpp_stanza_release(x); free(encrypted); } else { message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg); } jid_destroy(jidp); } else { message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg); } account_free(account);#else message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg);#endif free(jid); if (state) { stanza_attach_state(ctx, message, state); } stanza_attach_carbons_private(ctx, message); if (prefs_get_boolean(PREF_RECEIPTS_REQUEST)) { stanza_attach_receipt_request(ctx, message); } xmpp_send(conn, message); xmpp_stanza_release(message); return id;}
开发者ID:KThand1,项目名称:profanity,代码行数:57,
示例2: _iq_disco_items_requeststatic void_iq_disco_items_request(gchar *jid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_disco_items_iq(ctx, "discoitemsreq", jid); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:louiecaulfield,项目名称:profanity,代码行数:9,
示例3: message_send_gonevoidmessage_send_gone(const char *const jid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *stanza = stanza_create_chat_state(ctx, jid, STANZA_NAME_GONE); xmpp_send(conn, stanza); xmpp_stanza_release(stanza);}
开发者ID:KThand1,项目名称:profanity,代码行数:9,
示例4: _iq_send_software_versionstatic void_iq_send_software_version(const char * const fulljid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_software_version_iq(ctx, fulljid); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:louiecaulfield,项目名称:profanity,代码行数:9,
示例5: _iq_room_config_cancelstatic void_iq_room_config_cancel(const char * const room_jid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_room_config_cancel_iq(ctx, room_jid); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:dotoole,项目名称:profanity,代码行数:9,
示例6: _roster_send_add_newstatic void_roster_send_add_new(const char * const barejid, const char * const name){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_roster_set(ctx, NULL, barejid, name, NULL); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:mrshu,项目名称:profanity,代码行数:9,
示例7: roster_requestvoidroster_request(void){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_roster_iq(ctx); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:halfur,项目名称:profanity,代码行数:9,
示例8: _iq_confirm_instant_roomstatic void_iq_confirm_instant_room(const char * const room_jid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_instant_room_request_iq(ctx, room_jid); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:dotoole,项目名称:profanity,代码行数:9,
示例9: roster_send_removevoidroster_send_remove(const char * const barejid){ xmpp_conn_t * const conn = connection_get_conn(); xmpp_ctx_t * const ctx = connection_get_ctx(); xmpp_stanza_t *iq = stanza_create_roster_remove_set(ctx, barejid); xmpp_send(conn, iq); xmpp_stanza_release(iq);}
开发者ID:PMaynard,项目名称:profanity,代码行数:9,
示例10: HandleRpcCall/** * This is called when someone sends a RPC method call * Checks for XML-RPC format validation and sends error if so otherwise it calls the * HandleServiceCall for finding the right service and creating the right structures * @return KEEP_THIS_HANDLER_ACTIVE */int HandleRpcCall(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata) { xmpp_stanza_t *reply; xmpp_stanza_t *xmlRpcReply; xmpp_ctx_t *ctx = (xmpp_ctx_t*) userdata; sdvp_from_t* from; sdvp_reply_params_t* replyParams = NULL; int formatInvalid; sdvpIdleCounter = 0; sdvpPingsSent = 0; reply = xmpp_stanza_new(ctx); xmpp_stanza_set_name(reply, "iq"); // TODO: Get the Group and get the jid from = _CreateFrom(xmpp_stanza_get_attribute(stanza, "from"), "TODO", "TODO"); syslog(LOG_DEBUG, "Received a RPC Method call from %s/n", from->name); formatInvalid = _CheckRpcFormat(stanza); if (formatInvalid) { // FIXME: Something here fails! syslog(LOG_WARNING, "Error in XML-RPC format/n"); sdvp_InitiateReplyParameters(&replyParams, 1); replyParams->params[0].strValue = strdup("Error in XML-RPC format/n"); replyParams->params[0].type = IEC_VISIBLE_STRING; xmpp_stanza_set_type(reply, "error"); // TODO: Create a type //HJP var her! xmlRpcReply = _CreateReply(ctx, SDVP_METHOD_UNDEFINED ,replyParams); xmpp_stanza_add_child(reply, xmlRpcReply); //HJP: stanza_add_child laver en kopi, s C++ xmpp_stanza_get_attribute函数代码示例 C++ xmpp_free函数代码示例
|