annotate src/protocols/gg/confer.c @ 12760:c5acba513363

[gaim-migrate @ 15107] Request the public IP everytime it is used since there may be information or a new IP. committer: Tailor Script <tailor@pidgin.im>
author Thomas Butter <tbutter>
date Sun, 08 Jan 2006 01:16:23 +0000
parents 508512caa22e
children 4eae108efdde
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
1 /**
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
2 * @file confer.c
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
3 *
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
4 * gaim
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
5 *
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us>
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
7 *
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
12 *
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
17 *
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
21 */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
22
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
23
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
24 #include "lib/libgadu.h"
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
25 #include "gg.h"
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
26 #include "utils.h"
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
27 #include "confer.h"
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
28
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
29 /* GaimConversation *ggp_confer_find_by_name(GaimConnection *gc, const gchar *name) {{{ */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
30 GaimConversation *ggp_confer_find_by_name(GaimConnection *gc, const gchar *name)
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
31 {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
32 g_return_val_if_fail(gc != NULL, NULL);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
33 g_return_val_if_fail(name != NULL, NULL);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
34
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
35 return gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, name,
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
36 gaim_connection_get_account(gc));
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
37 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
38 /* }}} */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
39
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
40 /* void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name, const uin_t uin) {{{ */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
41 void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name,
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
42 const uin_t uin)
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
43 {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
44 GaimConversation *conv;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
45 GGPInfo *info = gc->proto_data;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
46 GGPChat *chat;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
47 GList *l;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
48 gchar *str_uin;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
49
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
50 str_uin = g_strdup_printf("%lu", (unsigned long int)uin);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
51
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
52 for (l = info->chats; l != NULL; l = l->next) {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
53 chat = l->data;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
54
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
55 if (g_utf8_collate(chat->name, chat_name) != 0)
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
56 continue;
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
57
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
58 if (g_list_find(chat->participants, str_uin) == NULL) {
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
59 GaimBuddy *buddy;
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
60
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
61 chat->participants = g_list_append(
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
62 chat->participants, str_uin);
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
63
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
64 conv = ggp_confer_find_by_name(gc, chat_name);
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
65
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
66 buddy = gaim_find_buddy(gaim_connection_get_account(gc), str_uin);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
67 if (buddy != NULL) {
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
68 gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
69 gaim_buddy_get_alias(buddy), NULL,
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
70 GAIM_CBFLAGS_NONE, TRUE);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
71 } else {
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
72 gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
73 str_uin, NULL,
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
74 GAIM_CBFLAGS_NONE, TRUE);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
75 }
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
76 }
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
77 break;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
78 }
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
79
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
80 g_free(str_uin);
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
81 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
82 /* }}} */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
83
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
84 /* void ggp_confer_participants_add(GaimConnection *gc, const gchar *chat_name, const uin_t *recipients, int count) {{{ */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
85 void ggp_confer_participants_add(GaimConnection *gc, const gchar *chat_name,
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
86 const uin_t *recipients, int count)
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
87 {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
88 GGPInfo *info = gc->proto_data;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
89 GList *l;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
90
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
91 for (l = info->chats; l != NULL; l = l->next) {
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
92 GGPChat *chat = l->data;
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
93 int i;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
94
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
95 if (g_utf8_collate(chat->name, chat_name) != 0)
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
96 continue;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
97
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
98 for (i = 0; i < count; i++) {
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
99 gchar *str_uin = g_strdup_printf("%lu", (unsigned long int)recipients[i]);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
100 GaimConversation *conv;
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
101 GaimBuddy *buddy;
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
102
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
103 if (g_list_find(chat->participants, str_uin) != NULL) {
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
104 g_free(str_uin);
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
105 continue;
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
106 }
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
107
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
108 chat->participants = g_list_append(chat->participants, str_uin);
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
109 conv = ggp_confer_find_by_name(gc, chat_name);
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
110
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
111 buddy = gaim_find_buddy(gaim_connection_get_account(gc), str_uin);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
112 if (buddy != NULL) {
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
113 gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
114 gaim_buddy_get_alias(buddy), NULL,
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
115 GAIM_CBFLAGS_NONE, TRUE);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
116 } else {
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
117 gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
118 str_uin, NULL,
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
119 GAIM_CBFLAGS_NONE, TRUE);
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
120 }
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
121 g_free(str_uin);
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
122 }
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
123 break;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
124 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
125 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
126 /* }}} */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
127
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
128 /* const char *ggp_confer_find_by_participants(GaimConnection *gc, const uin_t *recipients, int count) {{{ */
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
129 const char *ggp_confer_find_by_participants(GaimConnection *gc,
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
130 const uin_t *recipients, int count)
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
131 {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
132 GGPInfo *info = gc->proto_data;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
133 GGPChat *chat = NULL;
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
134 GList *l;
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
135 int matches;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
136
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
137 g_return_val_if_fail(info->chats != NULL, NULL);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
138
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
139 for (l = info->chats; l != NULL; l = l->next) {
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
140 GList *m;
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
141
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
142 chat = l->data;
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
143 matches = 0;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
144
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
145 for (m = chat->participants; m != NULL; m = m->next) {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
146 uin_t p = ggp_str_to_uin(m->data);
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
147 int i;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
148
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
149 for (i = 0; i < count; i++)
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
150 if (p == recipients[i])
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
151 matches++;
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
152 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
153
12373
508512caa22e [gaim-migrate @ 14677]
Richard Laager <rlaager@wiktel.com>
parents: 12007
diff changeset
154 if (matches == count)
11414
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
155 break;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
156
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
157 chat = NULL;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
158 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
159
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
160 if (chat == NULL)
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
161 return NULL;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
162 else
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
163 return chat->name;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
164 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
165 /* }}} */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
166
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
167 /* const char *ggp_confer_add_new(GaimConnection *gc, const char *name) {{{ */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
168 const char *ggp_confer_add_new(GaimConnection *gc, const char *name)
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
169 {
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
170 GGPInfo *info = gc->proto_data;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
171 GGPChat *chat;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
172
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
173 chat = g_new0(GGPChat, 1);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
174
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
175 if (name == NULL)
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
176 chat->name = g_strdup_printf("conf#%d", info->chats_count++);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
177 else
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
178 chat->name = g_strdup(name);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
179
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
180 chat->participants = NULL;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
181
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
182 info->chats = g_list_append(info->chats, chat);
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
183
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
184 return chat->name;
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
185 }
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
186 /* }}} */
d5599677bf32 [gaim-migrate @ 13651]
Bartoz Oler <bartosz@pidgin.im>
parents:
diff changeset
187
12007
8724718d387f [gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 11414
diff changeset
188 /* vim: set ts=8 sts=0 sw=8 noet: */