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

C++ purple_account_get_connection函数代码示例

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

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



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

示例1: msn_session_sync_users

static void
msn_session_sync_users(MsnSession *session)
{
	PurpleConnection *gc = purple_account_get_connection(session->account);
	GList *to_remove = NULL;
	GSList *buddies;

	g_return_if_fail(gc != NULL);

	/* The core used to use msn_add_buddy to add all buddies before
	 * being logged in. This no longer happens, so we manually iterate
	 * over the whole buddy list to identify sync issues.
	 */
	for (buddies = purple_find_buddies(session->account, NULL); buddies;
			buddies = g_slist_delete_link(buddies, buddies)) {
		PurpleBuddy *buddy = buddies->data;
		const gchar *buddy_name = purple_buddy_get_name(buddy);
		const gchar *group_name = purple_group_get_name(purple_buddy_get_group(buddy));
		MsnUser *remote_user;
		gboolean found = FALSE;

		remote_user = msn_userlist_find_user(session->userlist, buddy_name);
		if (remote_user && remote_user->list_op & MSN_LIST_FL_OP) {
			GList *l;
			for (l = remote_user->group_ids; l; l = l->next) {
				const char *name = msn_userlist_find_group_name(remote_user->userlist, l->data);
				if (name && !g_ascii_strcasecmp(group_name, name)) {
					found = TRUE;
					break;
				}
			}

			/* We don't care if they're in a different group, as long as they're on the
			 * list somewhere. If we check for the group, we cause pain, agony and
			 * suffering for people who decide to re-arrange their buddy list elsewhere.
			 */
			if (!found) {
				if ((remote_user == NULL) || !(remote_user->list_op & MSN_LIST_FL_OP)) {
					/* The user is not on the server list */
					msn_error_sync_issue(session, buddy_name, group_name);
				} else {
					/* The user is not in that group on the server list */
					to_remove = g_list_prepend(to_remove, buddy);
				}
			}
		}
	}

	if (to_remove != NULL) {
		g_list_foreach(to_remove, (GFunc)purple_blist_remove_buddy, NULL);
		g_list_free(to_remove);
	}
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:53,代码来源:session.c


示例2: purple_connection_get_protocol_data

static char *waprpl_status_text(PurpleBuddy * buddy)
{
	char *statusmsg;
	whatsapp_connection *wconn = purple_connection_get_protocol_data(purple_account_get_connection(purple_buddy_get_account(buddy)));
	if (!wconn)
		return 0;

	statusmsg = waAPI_getuserstatusstring(wconn->waAPI, purple_buddy_get_name(buddy));
	if (!statusmsg || strlen(statusmsg) == 0)
		return NULL;
	return statusmsg;
}
开发者ID:HackLabMX,项目名称:whatsapp-purple,代码行数:12,代码来源:wa_purple.c


示例3: oscar_auth_sendrequest_menu

void
oscar_auth_sendrequest_menu(PurpleBlistNode *node, gpointer ignored)
{
	PurpleBuddy *buddy;
	PurpleConnection *gc;

	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));

	buddy = (PurpleBuddy *) node;
	gc = purple_account_get_connection(purple_buddy_get_account(buddy));
	oscar_auth_sendrequest(gc, purple_buddy_get_name(buddy), NULL);
}
开发者ID:matyapiro31,项目名称:instantbird-1.5,代码行数:12,代码来源:authorization.c


示例4: adc_error

static void
adc_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
{
    MsnSession *session;
    PurpleAccount *account;
    PurpleConnection *gc;
    const char *list, *passport;
    const char *reason;
    char *msg = NULL;
    char **params;

    session = cmdproc->session;
    account = session->account;
    gc = purple_account_get_connection(account);
    params = g_strsplit(trans->params, " ", 0);

    list     = params[0];
    passport = params[1];

    if (!strcmp(list, "FL"))
        msg = pecan_strdup_printf(_("Unable to add user on %s (%s)"),
                                  purple_account_get_username(account),
                                  purple_account_get_protocol_name(account));
    else if (!strcmp(list, "BL"))
        msg = pecan_strdup_printf(_("Unable to block user on %s (%s)"),
                                  purple_account_get_username(account),
                                  purple_account_get_protocol_name(account));
    else if (!strcmp(list, "AL"))
        msg = pecan_strdup_printf(_("Unable to permit user on %s (%s)"),
                                  purple_account_get_username(account),
                                  purple_account_get_protocol_name(account));

    reason = pecan_error_to_string (error);

    if (msg != NULL)
    {
        purple_notify_error(gc, NULL, msg, reason);
        g_free(msg);
    }

    if (!strcmp(list, "FL"))
    {
        PurpleBuddy *buddy;

        buddy = purple_find_buddy(account, passport);

        if (buddy != NULL)
            purple_blist_remove_buddy(buddy);
    }

    g_strfreev(params);
}
开发者ID:deadcow,项目名称:msn-pecan,代码行数:52,代码来源:notification.c


示例5: irc_dccsend_network_listen_cb

static void
irc_dccsend_network_listen_cb(int sock, gpointer data)
{
	PurpleXfer *xfer = data;
	struct irc_xfer_send_data *xd;
	PurpleConnection *gc;
	struct irc_conn *irc;
	const char *arg[2];
	char *tmp;
	struct in_addr addr;
	unsigned short int port;

	xd = xfer->data;
	xd->listen_data = NULL;

	if (purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_LOCAL
			|| purple_xfer_get_status(xfer) == PURPLE_XFER_STATUS_CANCEL_REMOTE) {
		purple_xfer_unref(xfer);
		return;
	}

	xd = xfer->data;
	gc = purple_account_get_connection(purple_xfer_get_account(xfer));
	irc = gc->proto_data;

	purple_xfer_unref(xfer);

	if (sock < 0) {
		purple_notify_error(gc, NULL, _("File Transfer Failed"),
		                  _("Could not open a listening port."));
		purple_xfer_cancel_local(xfer);
		return;
	}

	xd->fd = sock;

	port = purple_network_get_port_from_fd(sock);
	purple_debug_misc("irc", "port is %hu\n", port);
	/* Monitor the listening socket */
	xfer->watcher = purple_input_add(sock, PURPLE_INPUT_READ,
	                               irc_dccsend_send_connected, xfer);

	/* Send the intended recipient the DCC request */
	arg[0] = xfer->who;
	inet_aton(purple_network_get_my_ip(irc->fd), &addr);
	arg[1] = tmp = g_strdup_printf("\001DCC SEND \"%s\" %u %hu %" G_GSIZE_FORMAT "\001",
	                         xfer->filename, ntohl(addr.s_addr),
	                         port, xfer->size);

	irc_cmd_privmsg(gc->proto_data, "msg", NULL, arg);
	g_free(tmp);
}
开发者ID:arminius2,项目名称:apolloim,代码行数:52,代码来源:dcc_send.c


示例6: irc_msg_join

void irc_msg_join(struct irc_conn *irc, const char *name, const char *from, char **args)
{
	PurpleConnection *gc = purple_account_get_connection(irc->account);
	PurpleConversation *convo;
	char *nick = irc_mask_nick(from), *userhost;
	struct irc_buddy *ib;
	static int id = 1;

	if (!gc) {
		g_free(nick);
		return;
	}

	if (!purple_utf8_strcasecmp(nick, purple_connection_get_display_name(gc))) {
		/* We are joining a channel for the first time */
		serv_got_joined_chat(gc, id++, args[0]);
		g_free(nick);
		convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
							    args[0],
							    irc->account);

		if (convo == NULL) {
			purple_debug_error("irc", "tried to join %s but couldn't\n", args[0]);
			return;
		}
		purple_conversation_set_data(convo, IRC_NAMES_FLAG,
					   GINT_TO_POINTER(FALSE));
		/* Until purple_conversation_present does something that
		 * one would expect in Pidgin, this call produces buggy
		 * behavior both for the /join and auto-join cases. */
		/* purple_conversation_present(convo); */
		return;
	}

	convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[0], irc->account);
	if (convo == NULL) {
		purple_debug(PURPLE_DEBUG_ERROR, "irc", "JOIN for %s failed\n", args[0]);
		g_free(nick);
		return;
	}

	userhost = irc_mask_userhost(from);
	purple_conv_chat_add_user(PURPLE_CONV_CHAT(convo), nick, userhost, PURPLE_CBFLAGS_NONE, TRUE);

	if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) {
		ib->flag = TRUE;
		irc_buddy_status(nick, ib, irc);
	}

	g_free(userhost);
	g_free(nick);
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:52,代码来源:msgs.c


示例7: bonjour_bytestreams_connect

static void
bonjour_bytestreams_connect(PurpleXfer *xfer)
{
	PurpleBuddy *pb;
	PurpleAccount *account = NULL;
	XepXfer *xf;
	char dstaddr[41];
	const gchar *name = NULL;
	unsigned char hashval[20];
	char *p;
	int i;

	if(xfer == NULL)
		return;

	purple_debug_info("bonjour", "bonjour-bytestreams-connect.\n");

	xf = (XepXfer*)xfer->data;
	if(!xf)
		return;

	pb = xf->pb;
	name = purple_buddy_get_name(pb);
	account = purple_buddy_get_account(pb);

	p = g_strdup_printf("%s%s%s", xf->sid, name, bonjour_get_jid(account));
	purple_cipher_digest_region("sha1", (guchar *)p, strlen(p),
				    sizeof(hashval), hashval, NULL);
	g_free(p);

	memset(dstaddr, 0, 41);
	p = dstaddr;
	for(i = 0; i < 20; i++, p += 2)
		snprintf(p, 3, "%02x", hashval[i]);

	xf->proxy_info = purple_proxy_info_new();
	purple_proxy_info_set_type(xf->proxy_info, PURPLE_PROXY_SOCKS5);
	purple_proxy_info_set_host(xf->proxy_info, xf->proxy_host);
	purple_proxy_info_set_port(xf->proxy_info, xf->proxy_port);
	xf->proxy_connection = purple_proxy_connect_socks5_account(
							   purple_account_get_connection(account),
							   account,
							   xf->proxy_info,
							   dstaddr, 0,
							   bonjour_bytestreams_connect_cb, xfer);

	if(xf->proxy_connection == NULL) {
		xep_ft_si_reject(xf->data, xf->iq_id, xfer->who, "404", "cancel");
		/* Cancel the connection */
		purple_xfer_cancel_local(xfer);
	}
}
开发者ID:dylex,项目名称:pidgin,代码行数:52,代码来源:bonjour_ft.c


示例8: stress_login

static void
stress_login(PurpleAccount *account) {
	PurpleConnection *pc = NULL;
	PurpleGroup *g = NULL;
	gint n_buddies = 0, i = 0, interval = 0, maxevents = 0;

	/* build our possible events from the account settings */
	add_event("trigger_signon", STRESS_EVENT_SIGN_ON, STRESS_EVENT_SIGN_OFF);
	add_event("trigger_idle", STRESS_EVENT_IDLE, STRESS_EVENT_UNIDLE);
	add_event("trigger_away", STRESS_EVENT_AWAY, STRESS_EVENT_BACK);
	add_event("trigger_typing", STRESS_EVENT_TYPING, STRESS_EVENT_STOPPED_TYPING);
	add_event("send_messages", STRESS_EVENT_SEND_MESSAGE, -1);

	nevents = g_list_length(events);

	/* get our connection and set it as online */
	pc = purple_account_get_connection(account);
	purple_connection_set_state(pc, PURPLE_CONNECTED);

	/* grab the account settings we need for buddies */
	n_buddies = purple_account_get_int(account, "nbuddies", 50);
	maxevents = purple_account_get_int(account, "maxevents", 100);
	interval = (guint)purple_account_get_int(account, "interval", 500);
	message_min = purple_account_get_int(account, "message_min", 16);
	message_max = purple_account_get_int(account, "message_max", 128);

	g = purple_group_new("prpl-stress");

	for(i = 0; i < n_buddies; i++) {
		PurpleBuddy *b = NULL;
		StressBuddy *sb = NULL;
		gchar *name = NULL;

		/* create the buddy and it's name */
		name = g_strdup_printf("stress-%04x", i);
		b = purple_buddy_new(account, name, NULL);
		g_free(name);

		/* add our data to the buddy */
		sb = g_new0(StressBuddy, 1);
		sb->buddy = b;
		sb->maxevents = maxevents;
		purple_buddy_set_protocol_data(b, sb);

		/* add the buddy to our list and the purple blist */
		buddies = g_list_prepend(buddies, sb);
		purple_blist_add_buddy(b, NULL, g, NULL);

		/* add our event timer to the buddy */
		sb->timer_id = g_timeout_add(interval, stress_event_cb, sb);
	}
}
开发者ID:Javran,项目名称:purple-plugin-pack,代码行数:52,代码来源:stress.c


示例9: tgprpl_roomlist_cancel

void tgprpl_roomlist_cancel (PurpleRoomlist *list) {
  PurpleConnection *gc = purple_account_get_connection (list->account);
  if (! gc) {
    return;
  }
  
  connection_data *conn = purple_connection_get_protocol_data (gc);
  purple_roomlist_set_in_progress (list, FALSE);
  if (conn->roomlist == list) {
    conn->roomlist = NULL;
    purple_roomlist_unref (list);
  }
}
开发者ID:Houlbek,项目名称:telegram-purple,代码行数:13,代码来源:tgp-chat.c


示例10: yahoo_doodle_send_draw_list

void yahoo_doodle_send_draw_list(PurpleWhiteboard *wb, GList *draw_list)
{
	PurpleAccount *account = purple_whiteboard_get_account(wb);
	PurpleConnection *gc = purple_account_get_connection(account);
	doodle_session *ds = purple_whiteboard_get_protocol_data(wb);
	char *message;

	g_return_if_fail(draw_list != NULL);

	message = yahoo_doodle_build_draw_string(ds, draw_list);
	yahoo_doodle_command_send_draw(gc, purple_whiteboard_get_who(wb), message, ds->imv_key);
	g_free(message);
}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:13,代码来源:yahoo_doodle.c


示例11: silcpurple_buddy_getkey_menu

static void
silcpurple_buddy_getkey_menu(PurpleBlistNode *node, gpointer data)
{
	PurpleBuddy *buddy;
	PurpleConnection *gc;

	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));

	buddy = (PurpleBuddy *) node;
	gc = purple_account_get_connection(buddy->account);

	silcpurple_buddy_getkey(gc, buddy->name);
}
开发者ID:dylex,项目名称:pidgin,代码行数:13,代码来源:buddy.c


示例12: netsoul_set_away

static void netsoul_set_away(PurpleAccount *account, PurpleStatus* status)
{
  int	ns_state;
  PurplePresence* state = purple_status_get_presence (status);

  if (purple_presence_is_available (state))
    ns_state = NS_STATE_ACTIF;
  else if (purple_presence_is_idle (state))
    ns_state = NS_STATE_IDLE;
  else
    ns_state = NS_STATE_AWAY;
  ns_send_state(purple_account_get_connection (account), ns_state, time(NULL));
}
开发者ID:Bocaa,项目名称:netsoul-purple,代码行数:13,代码来源:netsoul.c


示例13: yahoo_doodle_end

void yahoo_doodle_end(PurpleWhiteboard *wb)
{
	PurpleConnection *gc = purple_account_get_connection(wb->account);
	doodle_session *ds = wb->proto_data;

	/* g_debug_debug("yahoo", "doodle: yahoo_doodle_end()\n"); */

	if (gc && wb->state != DOODLE_STATE_CANCELLED)
		yahoo_doodle_command_send_shutdown(gc, wb->who);

	g_free(ds->imv_key);
	g_free(wb->proto_data);
}
开发者ID:Lilitana,项目名称:Pidgin,代码行数:13,代码来源:yahoo_doodle.c


示例14: notify_button_activated

static void
notify_button_activated(GntWidget *widget, PurpleNotifySearchButton *b)
{
	GList *list = NULL;
	PurpleAccount *account = g_object_get_data(G_OBJECT(widget), "notify-account");
	gpointer data = g_object_get_data(G_OBJECT(widget), "notify-data");

	list = gnt_tree_get_selection_text_list(GNT_TREE(g_object_get_data(G_OBJECT(widget), "notify-tree")));

	b->callback(purple_account_get_connection(account), list, data);
	g_list_foreach(list, (GFunc)g_free, NULL);
	g_list_free(list);
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:13,代码来源:gntnotify.c


示例15: iln_cmd

static void
iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
{
    MsnSession *session;
    PurpleAccount *account;
    PurpleConnection *gc;
    PecanContact *user;
#if defined(PECAN_CVR)
    MsnObject *msnobj;
#endif /* defined(PECAN_CVR) */
    const char *state, *passport;
    gchar *friendly;

    session = cmdproc->session;
    account = session->account;
    gc = purple_account_get_connection(account);

    state    = cmd->params[1];
    passport = cmd->params[2];
    friendly = pecan_url_decode(cmd->params[3]);

    user = pecan_contactlist_find_contact(session->contactlist, passport);

    pecan_contact_set_state(user, state);
    pecan_contact_set_friendly_name(user, friendly);

    if (cmd->param_count >= 5)
    {
        gulong client_id;
        client_id = atol (cmd->params[4]);
        pecan_contact_set_client_id (user, client_id);
    }

#if defined(PECAN_CVR)
    if (session->use_userdisplay)
    {
        if (cmd->param_count == 6)
        {
            gchar *tmp;
            tmp = pecan_url_decode (cmd->params[5]);
            msnobj = msn_object_new_from_string (tmp);
            pecan_contact_set_object(user, msnobj);
            g_free (tmp);
        }
    }
#endif /* defined(PECAN_CVR) */

    pecan_contact_update(user);

    g_free (friendly);
}
开发者ID:deadcow,项目名称:msn-pecan,代码行数:51,代码来源:notification.c


示例16: campfire_login

static void
campfire_login(PurpleAccount * account)
{
	/*don't really login (it's stateless), but init the CampfireConn */
	PurpleConnection *gc = purple_account_get_connection(account);
	const char *username = purple_account_get_username(account);
	CampfireConn *conn;
	char *pos;
	PurpleCmdFlag f = PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY;
	gchar *prpl_id = "prpl-analog_g-campfire";	/* analog_g = developer.pidgin.im Trac username */

	conn = g_new0(CampfireConn, 1);
	purple_debug_info("campfire", "num_xaction_malloc:%d: num_xaction_free:%d\n",
	                  conn->num_xaction_malloc,
	                  conn->num_xaction_free);
	conn->gc = gc;
	conn->account = account;

        /* Find the last '@'; usernames can have '@' in them. */
	pos = strrchr(username, '@');
	conn->hostname = g_strdup(pos+1);
	pos[0] = 0;
	purple_connection_set_display_name(gc, username);
	pos[0] = '@';

	purple_debug_info("campfire", "username: %s\n", username);
	purple_debug_info("campfire", "hostname: %s\n", conn->hostname);

	gc->proto_data = conn;

	/*register campfire commands */
	purple_cmd_register(CAMPFIRE_CMD_ME, "s", PURPLE_CMD_P_PRPL, f, prpl_id,
			    campfire_parse_cmd,
			    "me &lt;action to perform&gt;:  Perform an action.",
			    conn);
	purple_cmd_register(CAMPFIRE_CMD_TOPIC, "s", PURPLE_CMD_P_PRPL,
			    f | PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, prpl_id,
			    campfire_parse_cmd,
			    "topic &lt;new topic&gt;:  Change the room topic.",
			    conn);
	purple_cmd_register(CAMPFIRE_CMD_ROOM, "s", PURPLE_CMD_P_PRPL, f,
			    prpl_id, campfire_parse_cmd,
			    "room &lt;new room name&gt;:  Change the room name (admin only).",
			    conn);
	purple_cmd_register(CAMPFIRE_CMD_PLAY, "w", PURPLE_CMD_P_PRPL, f,
			    prpl_id, campfire_parse_cmd,
			    "play &lt;sound&gt;:  Play a sound (trombone, rimshot, crickets, live).",
			    conn);

	purple_connection_set_state(gc, PURPLE_CONNECTED);
}
开发者ID:CloCkWeRX,项目名称:campfire-libpurple,代码行数:51,代码来源:campfire.c


示例17: irc_send

int irc_send(struct irc_conn *irc, const char *buf)
{
	int ret, buflen;
 	char *tosend= g_strdup(buf);

	purple_signal_emit(_irc_plugin, "irc-sending-text", purple_account_get_connection(irc->account), &tosend);
	if (tosend == NULL)
		return 0;

	buflen = strlen(tosend);


	/* If we're not buffering writes, try to send immediately */
	if (!irc->writeh)
		ret = do_send(irc, tosend, buflen);
	else {
		ret = -1;
		errno = EAGAIN;
	}

	/* purple_debug(PURPLE_DEBUG_MISC, "irc", "sent%s: %s",
		irc->gsc ? " (ssl)" : "", tosend); */
	if (ret <= 0 && errno != EAGAIN) {
		purple_connection_error(purple_account_get_connection(irc->account),
				      _("Server has disconnected"));
	} else if (ret < buflen) {
		if (ret < 0)
			ret = 0;
		if (!irc->writeh)
			irc->writeh = purple_input_add(
				irc->gsc ? irc->gsc->fd : irc->fd,
				PURPLE_INPUT_WRITE, irc_send_cb, irc);
		purple_circ_buffer_append(irc->outbuf, tosend + ret,
			buflen - ret);
	}
	g_free(tosend);
	return ret;
}
开发者ID:arminius2,项目名称:apolloim,代码行数:38,代码来源:irc.c


示例18: flist_purple_set_status

void flist_purple_set_status(PurpleAccount *account, PurpleStatus *status) {
    PurpleConnection *pc = purple_account_get_connection(account);
    FListAccount *fla = pc->proto_data;
    PurpleStatusType *statusType = purple_status_get_type(status);
    GList *statusTypes = flist_status_types(account);
    GList *cur = statusTypes;
    FListStatus fStatus = FLIST_STATUS_UNKNOWN;
    
    // The status isn't active! bail!
    if (!purple_status_is_active(status))
        return;
    
    // First, get the presence. If it's idle, we default to idle.
    PurplePresence *presence = purple_status_get_presence(status);
    if(purple_presence_is_idle(presence)) {
        flist_set_status(fla, FLIST_STATUS_IDLE, purple_status_get_attr_string(status, FLIST_STATUS_MESSAGE_KEY));
    }
    
    // Alright, not idle. Next, compare StatusType IDs. If it's a match, use that.
    while(cur) {
        PurpleStatusType *type = cur->data;
        if(strcmp(purple_status_type_get_id(type), purple_status_type_get_id(statusType)) == 0){
            fStatus = flist_parse_status(purple_status_type_get_id(statusType));
            break;
        } else {
            cur = g_list_next(cur);
        }
    }
    // Found a matching F-list Status. Use it!
    if(fStatus != FLIST_STATUS_UNKNOWN) {
        flist_set_status(fla, fStatus, 	purple_status_get_attr_string(status, FLIST_STATUS_MESSAGE_KEY));
    } else {
        // Alright, seems the status we chose isn't an F-list one. Let's convert to the next best primitive.
        switch (purple_status_type_get_primitive(statusType)) {
            case PURPLE_STATUS_AWAY:
            case PURPLE_STATUS_EXTENDED_AWAY:
                flist_set_status(fla, FLIST_STATUS_AWAY, purple_status_get_attr_string(status, FLIST_STATUS_MESSAGE_KEY));
                break;
            case PURPLE_STATUS_UNAVAILABLE:
                flist_set_status(fla, FLIST_STATUS_DND, purple_status_get_attr_string(status, FLIST_STATUS_MESSAGE_KEY));
                break;
                
                // Assume AVAILABLE by default if it's not an AWAY/DND status
            default:
                flist_set_status(fla, FLIST_STATUS_AVAILABLE, purple_status_get_attr_string(status, FLIST_STATUS_MESSAGE_KEY));
        }
    }
    g_list_free(statusTypes);
    flist_update_server_status(fla);
}
开发者ID:Laleila,项目名称:fchat-pidgin,代码行数:50,代码来源:f-list_status.c


示例19: irc_msg_nosend

void irc_msg_nosend(struct irc_conn *irc, const char *name, const char *from, char **args)
{
	PurpleConnection *gc;
	PurpleConversation *convo;

	convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, args[1], irc->account);
	if (convo) {
		purple_conv_chat_write(PURPLE_CONV_CHAT(convo), args[1], args[2], PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL));
	} else {
		if ((gc = purple_account_get_connection(irc->account)) == NULL)
			return;
		purple_notify_error(gc, NULL, _("Could not send"), args[2]);
	}
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:14,代码来源:msgs.c


示例20: irc_msg_wallops

void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args)
{
	PurpleConnection *gc = purple_account_get_connection(irc->account);
	char *nick, *msg;

	if (!args || !args[0] || !gc)
		return;

	nick = irc_mask_nick(from);
	msg = g_strdup_printf (_("Wallops from %s"), nick);
	g_free(nick);
	purple_notify_info(gc, NULL, msg, args[0]);
	g_free(msg);
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:14,代码来源:msgs.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ purple_account_get_protocol_id函数代码示例发布时间:2022-05-30
下一篇:
C++ pulseIn函数代码示例发布时间: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