| 67 |
67 |
| 68 /* Create the conversation. */ |
68 /* Create the conversation. */ |
| 69 conversation = g_object_new( |
69 conversation = g_object_new( |
| 70 PURPLE_TYPE_CONVERSATION, |
70 PURPLE_TYPE_CONVERSATION, |
| 71 "account", account, |
71 "account", account, |
| 72 "name", "purple_conversation_autoset_title sucks", |
|
| 73 NULL); |
72 NULL); |
| 74 |
73 |
| 75 /* Add the conversation to the manager. */ |
74 /* Add the conversation to the manager. */ |
| 76 result = purple_conversation_manager_register(manager, conversation); |
75 result = purple_conversation_manager_register(manager, conversation); |
| 77 g_assert_true(result); |
76 g_assert_true(result); |
| 134 account = purple_account_new("test", "test"); |
133 account = purple_account_new("test", "test"); |
| 135 |
134 |
| 136 conversation = g_object_new( |
135 conversation = g_object_new( |
| 137 PURPLE_TYPE_CONVERSATION, |
136 PURPLE_TYPE_CONVERSATION, |
| 138 "account", account, |
137 "account", account, |
| 139 "name", "kool kats", |
|
| 140 NULL); |
138 NULL); |
| 141 purple_conversation_manager_register(manager, conversation); |
139 purple_conversation_manager_register(manager, conversation); |
| 142 |
140 |
| 143 /* Set the features and title of the conversation, and verify our counters. */ |
141 /* Set the features and title of the conversation, and verify our counters. */ |
| 144 purple_conversation_set_features(conversation, PURPLE_CONNECTION_FLAG_NO_IMAGES); |
142 purple_conversation_set_features(conversation, PURPLE_CONNECTION_FLAG_NO_IMAGES); |
| 183 |
181 |
| 184 conversation = g_object_new( |
182 conversation = g_object_new( |
| 185 PURPLE_TYPE_CONVERSATION, |
183 PURPLE_TYPE_CONVERSATION, |
| 186 "account", account, |
184 "account", account, |
| 187 "type", PURPLE_CONVERSATION_TYPE_DM, |
185 "type", PURPLE_CONVERSATION_TYPE_DM, |
| 188 "name", "bleh", |
|
| 189 NULL); |
186 NULL); |
| 190 |
187 |
| 191 ret = purple_conversation_manager_register(manager, conversation); |
188 ret = purple_conversation_manager_register(manager, conversation); |
| 192 g_assert_true(ret); |
189 g_assert_true(ret); |
| 193 |
190 |
| 236 PurpleConversationManager *manager = NULL; |
233 PurpleConversationManager *manager = NULL; |
| 237 |
234 |
| 238 manager = g_object_new(PURPLE_TYPE_CONVERSATION_MANAGER, NULL); |
235 manager = g_object_new(PURPLE_TYPE_CONVERSATION_MANAGER, NULL); |
| 239 |
236 |
| 240 account = purple_account_new("test", "test"); |
237 account = purple_account_new("test", "test"); |
| 241 contact = purple_contact_new(account, NULL); |
238 contact = purple_contact_new(account, |
| |
239 "a9780f2a-eeb5-4d6b-89cb-52e5dad3973f"); |
| 242 |
240 |
| 243 conversation1 = g_object_new( |
241 conversation1 = g_object_new( |
| 244 PURPLE_TYPE_CONVERSATION, |
242 PURPLE_TYPE_CONVERSATION, |
| 245 "account", account, |
243 "account", account, |
| 246 "type", PURPLE_CONVERSATION_TYPE_DM, |
244 "type", PURPLE_CONVERSATION_TYPE_DM, |
| 247 "name", "this is required for some reason", |
|
| 248 NULL); |
245 NULL); |
| 249 purple_conversation_manager_register(manager, conversation1); |
246 purple_conversation_manager_register(manager, conversation1); |
| 250 purple_conversation_add_member(conversation1, PURPLE_CONTACT_INFO(contact), |
247 purple_conversation_add_member(conversation1, PURPLE_CONTACT_INFO(contact), |
| 251 FALSE, NULL); |
248 FALSE, NULL); |
| 252 |
249 |
| 285 /* Create a conversation with the contact's account that's not a dm. */ |
282 /* Create a conversation with the contact's account that's not a dm. */ |
| 286 conversation1 = g_object_new( |
283 conversation1 = g_object_new( |
| 287 PURPLE_TYPE_CONVERSATION, |
284 PURPLE_TYPE_CONVERSATION, |
| 288 "account", account1, |
285 "account", account1, |
| 289 "type", PURPLE_CONVERSATION_TYPE_CHANNEL, |
286 "type", PURPLE_CONVERSATION_TYPE_CHANNEL, |
| 290 "name", "this is required for some reason", |
|
| 291 NULL); |
287 NULL); |
| 292 purple_conversation_manager_register(manager, conversation1); |
288 purple_conversation_manager_register(manager, conversation1); |
| 293 |
289 |
| 294 /* Create a conversation with the contact's account that is a dm but not |
290 /* Create a conversation with the contact's account that is a dm but not |
| 295 * with the contact. |
291 * with the contact. |
| 296 */ |
292 */ |
| 297 conversation2 = g_object_new( |
293 conversation2 = g_object_new( |
| 298 PURPLE_TYPE_CONVERSATION, |
294 PURPLE_TYPE_CONVERSATION, |
| 299 "account", account1, |
295 "account", account1, |
| 300 "type", PURPLE_CONVERSATION_TYPE_DM, |
296 "type", PURPLE_CONVERSATION_TYPE_DM, |
| 301 "name", "this is required for some reason", |
|
| 302 NULL); |
297 NULL); |
| 303 purple_conversation_manager_register(manager, conversation2); |
298 purple_conversation_manager_register(manager, conversation2); |
| 304 |
299 |
| 305 /* Create a conversation with a different account. */ |
300 /* Create a conversation with a different account. */ |
| 306 conversation3 = g_object_new( |
301 conversation3 = g_object_new( |
| 307 PURPLE_TYPE_CONVERSATION, |
302 PURPLE_TYPE_CONVERSATION, |
| 308 "account", account2, |
303 "account", account2, |
| 309 "type", PURPLE_CONVERSATION_TYPE_CHANNEL, |
304 "type", PURPLE_CONVERSATION_TYPE_CHANNEL, |
| 310 "name", "this is required for some reason", |
|
| 311 NULL); |
305 NULL); |
| 312 purple_conversation_manager_register(manager, conversation2); |
306 purple_conversation_manager_register(manager, conversation2); |
| 313 |
307 |
| 314 conversation4 = purple_conversation_manager_find_dm(manager, contact); |
308 conversation4 = purple_conversation_manager_find_dm(manager, contact); |
| 315 g_assert_null(conversation4); |
309 g_assert_null(conversation4); |