• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ purple_conversation_write函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中purple_conversation_write函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_conversation_write函数的具体用法?C++ purple_conversation_write怎么用?C++ purple_conversation_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了purple_conversation_write函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: translate_receiving_chat_msg_cb

void
translate_receiving_chat_msg_cb(const gchar *original_phrase, const gchar *translated_phrase, const gchar *detected_language, gpointer userdata)
{
	struct TranslateConvMessage *convmsg = userdata;
	PurpleChat *chat;
	gchar *html_text;
	const gchar *stored_lang = "";
	const gchar *language_name = NULL;
	gchar *message;
	
	if (detected_language)
	{
		chat = purple_blist_find_chat(convmsg->account, convmsg->conv->name);
		stored_lang = purple_blist_node_get_string((PurpleBlistNode *)chat, DEST_LANG_SETTING);
		purple_blist_node_set_string((PurpleBlistNode *)chat, DEST_LANG_SETTING, detected_language);
		
		language_name = get_language_name(detected_language);
		
		if (language_name != NULL)
		{
			message = g_strdup_printf("Now translating to %s (auto-detected)", language_name);
			purple_conversation_write(convmsg->conv, NULL, message, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, time(NULL));
			g_free(message);
		}
	}
	
	html_text = purple_strdup_withhtml(translated_phrase);
	
	purple_conversation_write(convmsg->conv, convmsg->sender, html_text, convmsg->flags, time(NULL));
	
	g_free(html_text);
	g_free(convmsg->sender);
	g_free(convmsg);
}
开发者ID:Javran,项目名称:purple-plugin-pack,代码行数:34,代码来源:translate.c


示例2: SendMsgTimeout_cb

void SendMsgTimeout_cb(struct fetion_account_data *sip, struct sipmsg *msg, struct transaction *tc)
{
	PurpleConversation *conv;
	const gchar *who;
	char *reason;
	who = sipmsg_find_header(msg,"T");
	if(!who) 
		return;

	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, sip->gc->account);
	if(conv)
	{
		switch (msg->response)
		{
			case 401:
				reason = g_strdup_printf(_("Message may have not been sent,because of Unauthoried !"));
				break;
			case 504:
				reason = g_strdup_printf(_("Message may have not been sent,because of Server Time-out !"));
				break;
			default:
				reason = g_strdup_printf(_("Message may have not been sent,because of timeout!"));
				
		}
		purple_conversation_write(conv, NULL, reason, PURPLE_MESSAGE_ERROR, time(NULL));
		purple_conversation_write(conv, NULL, msg->body, PURPLE_MESSAGE_RAW, time(NULL));

		g_free(reason);
	}


}
开发者ID:scljz,项目名称:fetion,代码行数:32,代码来源:f_chat.c


示例3: menu_action_sendkey_cb

/* ------------------
 * send public key to other person in conversation
 * ------------------ */
static void
menu_action_sendkey_cb(PurpleConversation *conv, void* data)
{
	// check if user selected a main key
	const char* fpr = purple_prefs_get_string(PREF_MY_KEY);
	if (fpr == NULL)
		fpr = "";
	if (strcmp(fpr,"") != 0)
	{
		char* key = NULL;
		// get key
		key = get_key_armored(fpr);

		if (key != NULL)
		{
			// send key
			PurpleConvIm* im_data = purple_conversation_get_im_data(conv);
			if (im_data != NULL)
			{
				purple_conv_im_send_with_flags(im_data,key,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_INVISIBLE | PURPLE_MESSAGE_RAW );
				purple_conversation_write(conv,"","Public key sent!",PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
			}
		}
	}else
	{
		purple_conversation_write(conv,"","You haven't selected a personal key yet.",PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
	}
}
开发者ID:bitboulder,项目名称:Pidgin-GPG,代码行数:31,代码来源:pidgin-gpg.c


示例4: menu_action_retrievekey_cb

/* ------------------
 * try to retrieve key from server
 * ------------------ */
static void
menu_action_retrievekey_cb(PurpleConversation *conv, void* data)
{
	char sys_msg_buffer[1000];
	// check if the user with the jid=conv->name has signed his presence
	char* bare_jid = get_bare_jid(conv->name);

	// get stored info about user
	struct list_item* item = g_hash_table_lookup(list_fingerprints,bare_jid);
	if (item != NULL)
	{
		char* userid = NULL;
		if (is_key_available(item->fpr,FALSE,TRUE,&userid) == FALSE)
		{
			sprintf(sys_msg_buffer,"Did not find key with ID '%s' on keyservers.",item->fpr);
			purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
		}else
		{
			// found key -> enable mode_enc
			sprintf(sys_msg_buffer,"Found key with ID '%s'/'%s' for '%s' on keyservers.",item->fpr,userid,bare_jid);
			purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
			purple_conversation_write(conv,"","Encryption enabled",PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
			item->mode_sec = TRUE;
		}
		if (userid != NULL)
			free(userid);
	}

	free(bare_jid);
}
开发者ID:bitboulder,项目名称:Pidgin-GPG,代码行数:33,代码来源:pidgin-gpg.c


示例5: conversation_created_cb

/* ------------------
 * called on new conversations
 * ------------------ */
void conversation_created_cb(PurpleConversation *conv, char* data)
{
	char sys_msg_buffer[1000];
	if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM)
		return;

	purple_debug_info(PLUGIN_ID, "conversation name: %s\n",conv->name);

	// check if the user with the jid=conv->name has signed his presence
	char* bare_jid = get_bare_jid(conv->name);

	// get stored info about user
	struct list_item* item = g_hash_table_lookup(list_fingerprints,bare_jid);
	if (item == NULL)
	{
		sprintf(sys_msg_buffer,"No encryption support in client of '%s'",bare_jid);
	}else
	{
		sprintf(sys_msg_buffer,"Client of user %s supports encryption",bare_jid);
	}

	// display a basic message
	purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));

	if (item != NULL)
	{
		char* userid = NULL;
		// check if we have key locally
		if (is_key_available(item->fpr,FALSE,FALSE,&userid) == FALSE)
		{
			if (userid != NULL)
				free(userid);
			userid = NULL;

			sprintf(sys_msg_buffer,"User has key with ID '%s', but we do not have it locally, try Options->\"Try to retrieve key of '%s' from server\"",item->fpr,bare_jid);
			purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
		}else
		{
			// key is already available locally -> enable mode_enc
			sprintf(sys_msg_buffer,"'%s' uses key with id '%s'/'%s'",bare_jid,userid,item->fpr);
			purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
			item->mode_sec = TRUE;
		}
		if (userid != NULL)
			free(userid);
		userid = NULL;
		// if we have the key now, move to secure mode
		if (item->mode_sec == TRUE)
			sprintf(sys_msg_buffer,"Encryption enabled");
		else
			sprintf(sys_msg_buffer,"Encryption disabled");
	}else
		sprintf(sys_msg_buffer,"Encryption disabled");

	// display message about received message
	purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));

	free(bare_jid);
}
开发者ID:bitboulder,项目名称:Pidgin-GPG,代码行数:62,代码来源:pidgin-gpg.c


示例6: fx_im_send

static int fx_im_send(PurpleConnection *gc, const gchar *who, const gchar *what, PurpleMessageFlags UNUSED(flags))
{
	PurpleBuddy    *buddy;
	PurplePresence *presence;
	PurpleStatus   *status;
	const gchar    *status_id;
	fetion_account  *sec;
	PurpleConversation *conv;
	fetion_account  *ac = purple_connection_get_protocol_data(gc);

	Contact        *cnt;
	gint            shutdown = 0;

	if(!(buddy = purple_find_buddy(ac->account, who))) return 0;
	presence = purple_buddy_get_presence(buddy);
	status   = purple_presence_get_active_status(presence);
	status_id = purple_status_get_id(status);

	cnt = fetion_contact_list_find_by_userid(ac->user->contactList, who);
	if(cnt->relationStatus == RELATION_STATUS_UNAUTHENTICATED) {
		if(!(conv = purple_find_conversation_with_account(
						PURPLE_CONV_TYPE_ANY, who, ac->account))) return -1;
			purple_conversation_write(conv, NULL,
					  _("Failed to send message: Unverified Buddy!"),
					  PURPLE_MESSAGE_ERROR, time(NULL));
			return -1;
	}
	
	if(cnt->serviceStatus == BASIC_SERVICE_ABNORMAL){
		if(cnt->carrierStatus == CARRIER_STATUS_CLOSED){
			shutdown = 1;
		}else{
			if((cnt->carrier[0] != '\0' && cnt->mobileno[0] == '\0') || cnt->carrier[0] == '\0')
				shutdown = 1;
		}
	}else if(cnt->carrierStatus == CARRIER_STATUS_DOWN)
		if(cnt->carrier[0] != '\0') shutdown = 1;

	if(shutdown) {
		if(!(conv = purple_find_conversation_with_account(
						PURPLE_CONV_TYPE_ANY, who, ac->account))) return -1;
			purple_conversation_write(conv, NULL,
					  _("Fail to send message: Buddy has cancled Fetion service!"),
					  PURPLE_MESSAGE_ERROR, time(NULL));
			return -1;
	}

	/* online,need invite */
	if(strcmp(status_id, "Offline") != 0) {
		if(!(sec = session_find(who))) new_chat(ac, who, what);
		else  fetion_send_sms(sec, who, what);
		return 1;
	}

	fetion_send_sms(ac, who, what);
	return 1;
}
开发者ID:amoblin,项目名称:flyshion,代码行数:57,代码来源:openfetion.c


示例7: purple_find_conversation_with_account

void Poller::op_notified_kickout_from_group(line::Operation &op) {
    std::string msg;

    if (op.param3 == parent.profile.mid) {
        msg = "You were removed from the group by ";
        parent.blist_remove_chat(op.param1, ChatType::GROUP);
    } else {
        msg = "Removed from the group by ";
        parent.blist_update_chat(op.param1, ChatType::GROUP);
    }

    if (parent.contacts.count(op.param2) == 1)
        msg += parent.contacts[op.param2].displayName;
    else
        msg += "(unknown contact)";

    PurpleConversation *conv = purple_find_conversation_with_account(
        PURPLE_CONV_TYPE_CHAT,
        op.param1.c_str(),
        parent.acct);

    if (conv) {
        purple_conversation_write(
            conv,
            op.param3.c_str(),
            msg.c_str(),
            PURPLE_MESSAGE_SYSTEM,
            time(NULL));
    }
}
开发者ID:devunt,项目名称:purple-line,代码行数:30,代码来源:poller.cpp


示例8: receiving_im_msg_cb

/* ------------------
 * called before display of received messages
 * ------------------ */
static gboolean
receiving_im_msg_cb(PurpleAccount *account, char **sender, char **buffer,
				    PurpleConversation *conv, PurpleMessageFlags *flags, void *data)
{
	char sys_msg_buffer[1000];

	// check if the user with the jid=conv->name has signed his presence
	char* bare_jid = get_bare_jid(*sender);

	// set default message
	sprintf(sys_msg_buffer,"Encryption disabled");

	// get encryption key
	struct list_item* item = g_hash_table_lookup(list_fingerprints,bare_jid);
	if (item != NULL)
	{
		if (item->mode_sec == TRUE)
			sprintf(sys_msg_buffer,"Encryption enabled");

		// display a basic message, only if mode changed
		if (item->mode_sec != item->mode_sec_old)
			purple_conversation_write(conv,"",sys_msg_buffer,PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
		item->mode_sec_old = item->mode_sec;
	}
	free(bare_jid);

	return FALSE;
}
开发者ID:bitboulder,项目名称:Pidgin-GPG,代码行数:31,代码来源:pidgin-gpg.c


示例9: sending_im_msg_cb

/* ------------------
 * called before message is sent
 * ------------------ */
void sending_im_msg_cb(PurpleAccount *account, const char *receiver,
                       char **message)
{
	PurpleConversation *gconv = NULL;

	// search for conversation
	gconv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, receiver, account);
	if(gconv)
	{
		// check if the user with the jid=conv->name has signed his presence
		char* bare_jid = get_bare_jid(gconv->name);
		// get stored info about user
		struct list_item* item = g_hash_table_lookup(list_fingerprints,bare_jid);
		if (item != NULL)
		{
			// if we are in private mode
			if (item->mode_sec == TRUE)
			{
				// try to get key
				if (is_key_available(item->fpr,FALSE,FALSE,NULL) == FALSE)
				{
					// we do not have key of receiver
					// -> cancel message sending
					free (*message);
					*message = NULL;

					// tell user of this
					purple_conversation_write(gconv,"","The key of the receiver is not available, please ask the receiver for the key before trying to encrypt messages.",PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG,time(NULL));
				}
			}
		}
		free(bare_jid);
	}
}
开发者ID:bitboulder,项目名称:Pidgin-GPG,代码行数:37,代码来源:pidgin-gpg.c


示例10: translate_conversation_created

static void
translate_conversation_created(PurpleConversation *conv)
{
	PurpleBlistNode *node = NULL;
	gchar *message;
	const gchar *language_key;
	const gchar *language_name;
	
	if (conv->type == PURPLE_CONV_TYPE_IM)
		node = (PurpleBlistNode *) purple_find_buddy(conv->account, conv->name);
	else if (conv->type == PURPLE_CONV_TYPE_CHAT)
		node = (PurpleBlistNode *) purple_blist_find_chat(conv->account, conv->name);
	
	if (node != NULL)
	{
		language_key = purple_blist_node_get_string(node, DEST_LANG_SETTING);
		
		if (language_key != NULL)
		{
			language_name = get_language_name(language_key);
		
			message = g_strdup_printf(_("Now translating to %s"), language_name);
			purple_conversation_write(conv, NULL, message, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LOG, time(NULL));
			g_free(message);
		}
	}
}
开发者ID:Javran,项目名称:purple-plugin-pack,代码行数:27,代码来源:translate.c


示例11: _start_stream

static void
_start_stream(gpointer data, gint source, PurpleInputCondition condition)
{
	BonjourJabberConversation *bconv = data;
	struct _stream_start_data *ss = bconv->stream_data;
	int len, ret;

	len = strlen(ss->msg);

	/* Start Stream */
	ret = send(source, ss->msg, len, 0);

	if (ret == -1 && errno == EAGAIN)
		return;
	else if (ret <= 0) {
		const char *err = g_strerror(errno);
		PurpleConversation *conv;
		const char *bname = bconv->buddy_name;
		BonjourBuddy *bb = NULL;

		if(bconv->pb) {
			bb = purple_buddy_get_protocol_data(bconv->pb);
			bname = purple_buddy_get_name(bconv->pb);
		}

		purple_debug_error("bonjour", "Error starting stream with buddy %s at %s error: %s\n",
				   bname ? bname : "(unknown)", bconv->ip, err ? err : "(null)");

		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, bname, bconv->account);
		if (conv != NULL)
			purple_conversation_write(conv, NULL,
				  _("Unable to send the message, the conversation couldn't be started."),
				  PURPLE_MESSAGE_SYSTEM, time(NULL));

		bonjour_jabber_close_conversation(bconv);
		if(bb != NULL)
			bb->conversation = NULL;

		return;
	}

	/* This is EXTREMELY unlikely to happen */
	if (ret < len) {
		char *tmp = g_strdup(ss->msg + ret);
		g_free(ss->msg);
		ss->msg = tmp;
		return;
	}

	g_free(ss->msg);
	g_free(ss);
	bconv->stream_data = NULL;

	/* Stream started; process the send buffer if there is one */
	purple_input_remove(bconv->tx_handler);
	bconv->tx_handler = 0;
	bconv->sent_stream_start = FULLY_SENT;

	bonjour_jabber_stream_started(bconv);
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:60,代码来源:jabber.c


示例12: tgp_msg_sys_out

void tgp_msg_sys_out (struct tgl_state *TLS, const char *msg, tgl_peer_id_t to_id, int no_log) {
  int flags = PURPLE_MESSAGE_SYSTEM;
  if (no_log) {
    flags |= PURPLE_MESSAGE_NO_LOG;
  }
  time_t now;
  time (&now);
  
  switch (tgl_get_peer_type (to_id)) {
    case TGL_PEER_CHAT:
      p2tgl_got_chat_in (TLS, to_id, to_id, msg, flags, now);
      break;
    case TGL_PEER_USER:
    case TGL_PEER_ENCR_CHAT: {
      const char *name = tgp_blist_lookup_purple_name (TLS, to_id);
      PurpleConversation *conv = p2tgl_find_conversation_with_account (TLS, to_id);
      
      g_return_if_fail (name);

      if (! conv) {
        conv = purple_conversation_new (PURPLE_CONV_TYPE_IM, tls_get_pa (TLS), name);
      }
      purple_conversation_write (conv, name, msg, flags, now);
      break;
    }
  }
}
开发者ID:Houlbek,项目名称:telegram-purple,代码行数:27,代码来源:tgp-msg.c


示例13: conversation_created_cb

static void
conversation_created_cb (PurpleConversation *conv, gpointer data)
{
    gchar *str;
    const gchar *tmp_user, *friendly_name;
    MsnSession *session = data;
    struct pn_contact *contact;

    tmp_user = purple_conversation_get_name (conv);
    contact = pn_contactlist_find_contact (session->contactlist, tmp_user);
    if (contact)
        friendly_name = pn_contact_get_friendly_name (contact);
    else
        friendly_name = tmp_user;
    if (!friendly_name)
        friendly_name = tmp_user;

    if (contact && !(contact->list_op & (1 << MSN_LIST_RL)))
    {
        str = g_strdup_printf (_("You are not in %s's contact list."), friendly_name);

        purple_conversation_write (conv, NULL, str, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY, time (NULL));

        g_free (str);
    }
}
开发者ID:allanfreitas,项目名称:msn-pecan,代码行数:26,代码来源:session.c


示例14: bonjour_jabber_stream_ended

static void bonjour_jabber_stream_ended(BonjourJabberConversation *bconv) {

	/* Inform the user that the conversation has been closed */
	BonjourBuddy *bb = NULL;
	const gchar *name = bconv->pb ? purple_buddy_get_name(bconv->pb) : "(unknown)";

	purple_debug_info("bonjour", "Received conversation close notification from %s.\n", name);

	if(bconv->pb != NULL)
		bb = purple_buddy_get_protocol_data(bconv->pb);
#if 0
	if(bconv->pb != NULL) {
		PurpleConversation *conv;
		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, bconv->pb->name, bconv->pb->account);
		if (conv != NULL) {
			char *tmp = g_strdup_printf(_("%s has closed the conversation."), bconv->pb->name);
			purple_conversation_write(conv, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL));
			g_free(tmp);
		}
	}
#endif
	/* Close the socket, clear the watcher and free memory */
	bonjour_jabber_close_conversation(bconv);
	if(bb)
		bb->conversation = NULL;
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:26,代码来源:jabber.c


示例15: qq_sys_msg_write

void qq_sys_msg_write(qq_account* ac,LwqqMsgType m_t,const char* serv_id,const char* msg,PurpleMessageFlags type,time_t t)
{
	//ac->qq->dispatch(vp_func_2p,(CALLBACK_FUNC)sys_msg_write,ac->qq,system_msg_new(m_t,serv_id,ac,msg,type,t));

	PurpleConversation* conv = find_conversation(m_t,serv_id,ac);
	if(conv)
		purple_conversation_write(conv,NULL,msg,type,t);
}
开发者ID:5rather,项目名称:pidgin-lwqq,代码行数:8,代码来源:qq_types.c


示例16: yahoo_process_conference_decline

void yahoo_process_conference_decline(PurpleConnection *gc, struct yahoo_packet *pkt)
{
	GSList *l;
	char *room = NULL;
	char *who = NULL;
	char *msg = NULL;
	PurpleConversation *c = NULL;
	int utf8 = 0;

	for (l = pkt->hash; l; l = l->next) {
		struct yahoo_pair *pair = l->data;

		switch (pair->key) {
		case 57:
			g_free(room);
			room = yahoo_string_decode(gc, pair->value, FALSE);
			break;
		case 54:
			who = pair->value;
			break;
		case 14:
			g_free(msg);
			msg = yahoo_string_decode(gc, pair->value, FALSE);
			break;
		case 97:
			utf8 = strtol(pair->value, NULL, 10);
			break;
		}
	}
	if (!purple_privacy_check(purple_connection_get_account(gc), who))
	{
		g_free(room);
		g_free(msg);
		return;
	}

	if (who && room) {
		/* make sure we're in the room before we process a decline message for it */
		if((c = yahoo_find_conference(gc, room))) {
			char *tmp = NULL, *msg_tmp = NULL;
			if(msg)
			{
				msg_tmp = yahoo_string_decode(gc, msg, utf8);
				msg = yahoo_codes_to_html(msg_tmp);
				serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(c)), who, 0, msg, time(NULL));
				g_free(msg_tmp);
				g_free(msg);
			}

			tmp = g_strdup_printf(_("%s has declined to join."), who);
			purple_conversation_write(c, NULL, tmp, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));

			g_free(tmp);
		}

		g_free(room);
	}
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:58,代码来源:yahoochat.c


示例17: hon_parse_userinfo

void hon_parse_userinfo(PurpleConnection* gc,gchar* buffer,guint16 packet_id){
    hon_account* hon = gc->proto_data;
    /* TODO: this is not right .. conversation could be closed already */
    gchar* message = NULL;
    gchar* name = NULL,*strtime = NULL;
    gchar* user = read_string(buffer);
    if (!hon->whois_conv)
        return;

    switch (packet_id){
    case 0x2b:
        message = g_strdup_printf(_("Cannot find user %s"),user);
        break;
    case 0x2c:
        message = g_strdup_printf(_("User %s is offline, last seen %s"),user,buffer);
        break;
    case 0x2d:
        {
            GString* msg = g_string_new(NULL);
            guint32 chan_count = read_guint32(buffer);
            if (chan_count > 0)
                g_string_printf(msg,_("User %s is online and in channels: "),user);
            else
                g_string_printf(msg,_("User %s is online."),user);
            while (chan_count--)
            {
                msg = g_string_append(msg,buffer);
                if (chan_count == 0)
                    msg = g_string_append(msg,".");
                else
                    msg = g_string_append(msg,", ");
                read_string(buffer);
            }
            message = g_string_free(msg,FALSE);
        }
        break;
    case 0x2e:
        name = read_string(buffer);
        strtime = read_string(buffer);
        message = g_strdup_printf(_("User %s is ingame, game name: %s, game time: %s"),user,name,strtime);
        break;
    }

    purple_conversation_write(hon->whois_conv, "",message, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL));
    g_free(message);
    
    
#ifdef MINBIF
    if (packet_id == 0x2e)
        message = g_strdup_printf("%s %s %d %s %s", MINBIF_INFO,user,packet_id, strtime, name);
    else
        message = g_strdup_printf("%s %s %d", MINBIF_INFO,user,packet_id);
    serv_got_im(gc,MINBIF_USER,message,PURPLE_MESSAGE_RECV,time(NULL));
    g_free(message);
#endif
    hon->whois_conv = NULL;
}
开发者ID:theli-ua,项目名称:honpurple,代码行数:57,代码来源:hon.c


示例18: msn_session_report_user

/* put Message to User Conversation
 *
 * 	passport - the one want to talk to you
 */
void
msn_session_report_user(MsnSession *session,const char *passport,const char *msg,PurpleMessageFlags flags)
{
	PurpleConversation * conv;

	if ((conv = msn_session_get_conv(session,passport)) != NULL){
		purple_conversation_write(conv, NULL, msg, flags, time(NULL));
	}
}
开发者ID:Tasssadar,项目名称:libpurple,代码行数:13,代码来源:session.c


示例19: pidgin_media_emit_message

static void
pidgin_media_emit_message(PidginMedia *gtkmedia, const char *msg)
{
	PurpleConversation *conv = purple_find_conversation_with_account(
			PURPLE_CONV_TYPE_ANY, gtkmedia->priv->screenname,
			purple_media_get_account(gtkmedia->priv->media));
	if (conv != NULL)
		purple_conversation_write(conv, NULL, msg,
				PURPLE_MESSAGE_SYSTEM, time(NULL));
}
开发者ID:dylex,项目名称:pidgin,代码行数:10,代码来源:gtkmedia.c


示例20: purple_xfer_conversation_write_internal

static void 
purple_xfer_conversation_write_internal(PurpleXfer *xfer,
	const char *message, gboolean is_error, gboolean print_thumbnail)
{
	PurpleConversation *conv = NULL;
	PurpleMessageFlags flags = PURPLE_MESSAGE_SYSTEM;
	char *escaped;
	gconstpointer thumbnail_data;
	gsize size;

	g_return_if_fail(xfer != NULL);
	g_return_if_fail(message != NULL);

	thumbnail_data = purple_xfer_get_thumbnail(xfer, &size);

	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, xfer->who,
											   purple_xfer_get_account(xfer));

	if (conv == NULL)
		return;

	escaped = g_markup_escape_text(message, -1);

	if (is_error)
		flags |= PURPLE_MESSAGE_ERROR;

	if (print_thumbnail && thumbnail_data) {
		gchar *message_with_img;
		gpointer data = g_memdup(thumbnail_data, size); 
		int id = purple_imgstore_add_with_id(data, size, NULL);

		message_with_img = 
			g_strdup_printf("<img id='%d'> %s", id, escaped);
		purple_conversation_write(conv, NULL, message_with_img, flags, 
			time(NULL));
		purple_imgstore_unref_by_id(id);
		g_free(message_with_img);
	} else {
		purple_conversation_write(conv, NULL, escaped, flags, time(NULL));
	}
	g_free(escaped);
}
开发者ID:crodjer,项目名称:pidgin_whiteboard,代码行数:42,代码来源:ft.c



注:本文中的purple_conversation_write函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ purple_conversations_get_handle函数代码示例发布时间:2022-05-30
下一篇:
C++ purple_conversation_get_name函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap