本文整理汇总了C++中purple_conversation_get_name函数的典型用法代码示例。如果您正苦于以下问题:C++ purple_conversation_get_name函数的具体用法?C++ purple_conversation_get_name怎么用?C++ purple_conversation_get_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purple_conversation_get_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: yahoo_c_send
int yahoo_c_send(PurpleConnection *gc, int id, const char *what, PurpleMessageFlags flags)
{
PurpleConversation *c;
int ret;
YahooData *yd;
yd = (YahooData *) gc->proto_data;
if (!yd)
return -1;
c = purple_find_chat(gc, id);
if (!c)
return -1;
if (id != YAHOO_CHAT_ID) {
ret = yahoo_conf_send(gc, purple_connection_get_display_name(gc),
purple_conversation_get_name(c), purple_conv_chat_get_users(PURPLE_CONV_CHAT(c)), what);
} else {
ret = yahoo_chat_send(gc, purple_connection_get_display_name(gc),
purple_conversation_get_name(c), what, flags);
if (!ret)
serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(c)),
purple_connection_get_display_name(gc), flags, what, time(NULL));
}
return ret;
}
示例2: yahoo_c_send
int yahoo_c_send(PurpleConnection *gc, int id, PurpleMessage *msg)
{
PurpleChatConversation *c;
int ret;
YahooData *yd;
const gchar *what = purple_message_get_contents(msg);
PurpleMessageFlags flags = purple_message_get_flags(msg);
yd = purple_connection_get_protocol_data(gc);
if (!yd)
return -1;
c = purple_conversations_find_chat(gc, id);
if (!c)
return -1;
if (id != YAHOO_CHAT_ID) {
GList *users;
users = purple_chat_conversation_get_users(c);
ret = yahoo_conf_send(gc,
purple_connection_get_display_name(gc),
purple_conversation_get_name(PURPLE_CONVERSATION(c)),
users, what);
g_list_free(users);
} else {
ret = yahoo_chat_send(gc, purple_connection_get_display_name(gc),
purple_conversation_get_name(PURPLE_CONVERSATION(c)), what, flags);
if (!ret)
purple_serv_got_chat_in(gc, purple_chat_conversation_get_id(c),
purple_connection_get_display_name(gc), flags, what, time(NULL));
}
return ret;
}
示例3: yahoo_c_leave
void yahoo_c_leave(PurpleConnection *gc, int id)
{
YahooData *yd = purple_connection_get_protocol_data(gc);
PurpleChatConversation *c;
if (!yd)
return;
c = purple_conversations_find_chat(gc, id);
if (!c)
return;
if (id != YAHOO_CHAT_ID) {
GList *users;
users = purple_chat_conversation_get_users(c);
yahoo_conf_leave(yd,
purple_conversation_get_name(PURPLE_CONVERSATION(c)),
purple_connection_get_display_name(gc), users);
g_list_free(users);
yd->confs = g_slist_remove(yd->confs, c);
} else {
yahoo_chat_leave(gc, purple_conversation_get_name(PURPLE_CONVERSATION(c)),
purple_connection_get_display_name(gc), TRUE);
}
purple_serv_got_chat_left(gc, id);
}
示例4: irc_chat_invite
static void irc_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name)
{
struct irc_conn *irc = gc->proto_data;
PurpleConversation *convo = purple_find_chat(gc, id);
const char *args[2];
if (!convo) {
purple_debug(PURPLE_DEBUG_ERROR, "irc", "Got chat invite request for bogus chat\n");
return;
}
args[0] = name;
args[1] = purple_conversation_get_name(convo);
irc_cmd_invite(irc, "invite", purple_conversation_get_name(convo), args);
}
示例5: irc_chat_leave
static void irc_chat_leave (PurpleConnection *gc, int id)
{
struct irc_conn *irc = gc->proto_data;
PurpleConversation *convo = purple_find_chat(gc, id);
const char *args[2];
if (!convo)
return;
args[0] = purple_conversation_get_name(convo);
args[1] = NULL;
irc_cmd_part(irc, "part", purple_conversation_get_name(convo), args);
serv_got_chat_left(gc, id);
}
示例6: nullprpl_chat_invite
static void nullprpl_chat_invite(PurpleConnection *gc, int id,
const char *message, const char *who) {
const char *username = purple_account_get_username(purple_connection_get_account(gc));
PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
const char *room = purple_conversation_get_name(PURPLE_CONVERSATION(chat));
PurpleAccount *to_acct = purple_accounts_find(who, NULLPRPL_ID);
purple_debug_info("nullprpl", "%s is inviting %s to join chat room %s\n",
username, who, room);
if (to_acct) {
PurpleChatConversation *to_conv = purple_conversations_find_chat(purple_account_get_connection(to_acct), id);
if (to_conv) {
char *tmp = g_strdup_printf("%s is already in chat room %s.", who, room);
purple_debug_info("nullprpl",
"%s is already in chat room %s; "
"ignoring invitation from %s\n",
who, room, username);
purple_notify_info(gc, _("Chat invitation"), _("Chat invitation"), tmp,
purple_request_cpar_from_conversation(PURPLE_CONVERSATION(to_conv)));
g_free(tmp);
} else {
GHashTable *components;
components = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
g_hash_table_replace(components, "room", g_strdup(room));
g_hash_table_replace(components, "invited_by", g_strdup(username));
purple_serv_got_chat_invite(purple_account_get_connection(to_acct), room, username, message, components);
}
}
}
示例7: otrg_conversation_get_contexts
GList *
otrg_conversation_get_contexts(PurpleConversation *conv)
{
PurpleAccount *account;
const gchar *accountname, *protocol;
gchar *username;
ConnContext *it = NULL;
GList *contexts = NULL;
g_return_val_if_fail(conv != NULL, NULL);
g_return_val_if_fail(PURPLE_IS_IM_CONVERSATION(conv), NULL);
account = purple_conversation_get_account(conv);
accountname = purple_account_get_username(account);
protocol = purple_account_get_protocol_id(account);
username = g_strdup(purple_normalize(account,
purple_conversation_get_name(conv)));
for (it = otrg_plugin_userstate->context_root; it; it = it->next) {
if (g_strcmp0(it->accountname, accountname) != 0)
continue;
if (g_strcmp0(it->protocol, protocol) != 0)
continue;
if (g_strcmp0(it->username, username) != 0)
continue;
contexts = g_list_append(contexts, it);
}
g_free(username);
return contexts;
}
示例8: _purple_conversations_update_cache
void
_purple_conversations_update_cache(PurpleConversation *conv, const char *name,
PurpleAccount *account)
{
PurpleAccount *old_account;
struct _purple_hconv *hc;
g_return_if_fail(conv != NULL);
g_return_if_fail(account != NULL || name != NULL);
old_account = purple_conversation_get_account(conv);
hc = g_new(struct _purple_hconv, 1);
hc->im = PURPLE_IS_IM_CONVERSATION(conv);
hc->account = old_account;
hc->name = (gchar *)purple_normalize(old_account,
purple_conversation_get_name(conv));
g_hash_table_remove(conversation_cache, hc);
if (account)
hc->account = account;
if (name)
hc->name = g_strdup(purple_normalize(hc->account, name));
g_hash_table_insert(conversation_cache, hc, conv);
}
示例9: pidginwhiteboard_button_start_press
static void pidginwhiteboard_button_start_press(GtkButton *button, gpointer data)
{
PurpleConversation *conv = data;
PurpleAccount *account = purple_conversation_get_account(conv);
PurpleConnection *gc = purple_account_get_connection(account);
char *to = (char*)(purple_conversation_get_name(conv));
/* Only handle this if local client requested Doodle session (else local
* client would have sent one)
*/
PurpleWhiteboard *wb = purple_whiteboard_get(account, to);
/* Write a local message to this conversation showing that a request for a
* Doodle session has been made
*/
/* XXXX because otherwise gettext will see this string, even though it's
* in an #if 0 block. Remove the XXXX if you want to use this code.
* But, it really shouldn't be a Yahoo-specific string. ;) */
purple_conv_im_write(PURPLE_CONV_IM(conv), "", XXXX_("Sent Doodle request."),
PURPLE_MESSAGE_NICK | PURPLE_MESSAGE_RECV, time(NULL));
yahoo_doodle_command_send_request(gc, to);
yahoo_doodle_command_send_ready(gc, to);
/* Insert this 'session' in the list. At this point, it's only a requested
* session.
*/
wb = purple_whiteboard_create(account, to, DOODLE_STATE_REQUESTING);
}
示例10: yahoo_process_chat_exit
void yahoo_process_chat_exit(PurpleConnection *gc, struct yahoo_packet *pkt)
{
char *who = NULL;
char *room = NULL;
GSList *l;
for (l = pkt->hash; l; l = l->next) {
struct yahoo_pair *pair = l->data;
if (pair->key == 104) {
g_free(room);
room = yahoo_string_decode(gc, pair->value, TRUE);
}
if (pair->key == 109)
who = pair->value;
}
if (who && room) {
PurpleConversation *c = purple_find_chat(gc, YAHOO_CHAT_ID);
if (c && !purple_utf8_strcasecmp(purple_conversation_get_name(c), room))
purple_conv_chat_remove_user(PURPLE_CONV_CHAT(c), who, NULL);
}
g_free(room);
}
示例11: purple_conversations_add
void
purple_conversations_add(PurpleConversation *conv)
{
PurpleAccount *account;
struct _purple_hconv *hc;
g_return_if_fail(conv != NULL);
if (g_list_find(conversations, conv) != NULL)
return;
conversations = g_list_prepend(conversations, conv);
if (PURPLE_IS_IM_CONVERSATION(conv))
ims = g_list_prepend(ims, conv);
else
chats = g_list_prepend(chats, conv);
account = purple_conversation_get_account(conv);
hc = g_new(struct _purple_hconv, 1);
hc->name = g_strdup(purple_normalize(account,
purple_conversation_get_name(conv)));
hc->account = account;
hc->im = PURPLE_IS_IM_CONVERSATION(conv);
g_hash_table_insert(conversation_cache, hc, conv);
}
示例12: irc_receiving_text
static void
irc_receiving_text(PurpleConnection *gc, const char **incoming, gpointer null)
{
char **splits, *str;
PurpleAccount *account = NULL;
if (!incoming || !*incoming || !**incoming) /* oh the fun .. I can do this all day! */
return;
splits = g_strsplit(*incoming, " ", -1);
/* if there's not at least 5 elements in the string array, this isn't a kick; ignore */
if(g_strv_length(splits) < 5)
return;
account = purple_connection_get_account(gc);
str = g_ascii_strdown(splits[1], -1);
if (strcmp(str, "kick") == 0 && splits[2] && splits[3]) {
char *name = splits[2];
GList *chats = purple_get_chats();
while (chats) {
PurpleConversation *conv = chats->data;
chats = chats->next;
if (purple_conversation_get_account(conv) == account
&& strcmp(purple_conversation_get_name(conv), name) == 0) {
purple_timeout_add(100, show_them, conv);
break;
}
}
}
g_free(str);
g_strfreev(splits);
}
示例13: displayed_chat_msg_cb
static void
displayed_chat_msg_cb(PurpleConversation *conv, PurpleMessage *msg, gpointer data)
{
purple_debug_misc("gtk-signals test", "displayed-chat-msg (%s, %s)\n",
purple_conversation_get_name(conv),
purple_message_get_contents(msg));
}
示例14: music_messaging_change_request
/* Exported functions */
DBUS_EXPORT void
music_messaging_change_request(const int session, const char *command,
const char *parameters)
{
MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
if (mmconv->started)
{
if (mmconv->originator)
{
const char *name = purple_conversation_get_name(mmconv->conv);
send_change_request (session, name, command, parameters);
} else
{
GString *to_send = g_string_new("");
g_string_append_printf(to_send, "##MM## request %s %s##MM##", command, parameters);
purple_conversation_send(mmconv->conv, to_send->str);
purple_debug_misc("musicmessaging", "Sent request: %s\n", to_send->str);
}
}
}
示例15: send_request_confirmed
static void send_request_confirmed(MMConversation *mmconv)
{
PurpleConnection *connection = purple_conversation_get_connection(mmconv->conv);
const char *convName = purple_conversation_get_name(mmconv->conv);
purple_serv_send_im(connection, purple_message_new_outgoing(
convName, MUSICMESSAGING_CONFIRM_MSG, 0));
}