Sat, 29 Jun 2013 01:19:17 +0530
Assign PurpleChatConversationBuddy initialization properties directly
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1 | /* |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
2 | * purple |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
3 | * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too numerous |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
6 | * source distribution. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
7 | * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
11 | * (at your option) any later version. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
12 | * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
17 | * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
21 | */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
22 | #include "internal.h" |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
23 | #include "conversationtypes.h" |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
24 | #include "dbus-maybe.h" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
25 | #include "debug.h" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
26 | #include "enums.h" |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
27 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
28 | #define SEND_TYPED_TIMEOUT_SECONDS 5 |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
29 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
30 | #define PURPLE_CHAT_CONVERSATION_GET_PRIVATE(obj) \ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
31 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_CHAT_CONVERSATION, PurpleChatConversationPrivate)) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
32 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
33 | /** @copydoc _PurpleChatConversationPrivate */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
34 | typedef struct _PurpleChatConversationPrivate PurpleChatConversationPrivate; |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
35 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
36 | #define PURPLE_IM_CONVERSATION_GET_PRIVATE(obj) \ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
37 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_IM_CONVERSATION, PurpleIMConversationPrivate)) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
38 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
39 | /** @copydoc _PurpleIMConversationPrivate */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
40 | typedef struct _PurpleIMConversationPrivate PurpleIMConversationPrivate; |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
41 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
42 | #define PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(obj) \ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
43 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_CHAT_CONVERSATION_BUDDY, PurpleChatConversationBuddyPrivate)) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
44 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
45 | /** @copydoc _PurpleChatConversationBuddyPrivate */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
46 | typedef struct _PurpleChatConversationBuddyPrivate PurpleChatConversationBuddyPrivate; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
47 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
48 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
49 | * Data specific to Chats. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
50 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
51 | struct _PurpleChatConversationPrivate |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
52 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
53 | GList *in_room; /**< The users in the room. |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
54 | * @deprecated Will be removed in 3.0.0 TODO |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
55 | */ |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
56 | GList *ignored; /**< Ignored users. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
57 | char *who; /**< The person who set the topic. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
58 | char *topic; /**< The topic. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
59 | int id; /**< The chat ID. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
60 | char *nick; /**< Your nick in this chat. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
61 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
62 | gboolean left; /**< We left the chat and kept the window open */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
63 | GHashTable *users; /**< Hash table of the users in the room. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
64 | }; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
65 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
66 | /* Chat Property enums */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
67 | enum { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
68 | CHAT_PROP_0, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
69 | CHAT_PROP_TOPIC_WHO, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
70 | CHAT_PROP_TOPIC, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
71 | CHAT_PROP_ID, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
72 | CHAT_PROP_NICK, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
73 | CHAT_PROP_LEFT, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
74 | CHAT_PROP_LAST |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
75 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
76 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
77 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
78 | * Data specific to Instant Messages. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
79 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
80 | struct _PurpleIMConversationPrivate |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
81 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
82 | PurpleIMConversationTypingState typing_state; /**< The current typing state. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
83 | guint typing_timeout; /**< The typing timer handle. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
84 | time_t type_again; /**< The type again time. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
85 | guint send_typed_timeout; /**< The type again timer handle. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
86 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
87 | PurpleBuddyIcon *icon; /**< The buddy icon. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
88 | }; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
89 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
90 | /* IM Property enums */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
91 | enum { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
92 | IM_PROP_0, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
93 | IM_PROP_TYPING_STATE, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
94 | IM_PROP_ICON, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
95 | IM_PROP_LAST |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
96 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
97 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
98 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
99 | * Data for "Chat Buddies" |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
100 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
101 | struct _PurpleChatConversationBuddyPrivate |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
102 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
103 | /** The chat */ |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
104 | PurpleChatConversation *chat; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
105 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
106 | /** The chat participant's name in the chat. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
107 | char *name; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
108 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
109 | /** The chat participant's alias, if known; @a NULL otherwise. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
110 | char *alias; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
111 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
112 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
113 | * A string by which this buddy will be sorted, or @c NULL if the |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
114 | * buddy should be sorted by its @c name. (This is currently always |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
115 | * @c NULL. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
116 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
117 | char *alias_key; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
118 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
119 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
120 | * @a TRUE if this chat participant is on the buddy list; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
121 | * @a FALSE otherwise. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
122 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
123 | gboolean buddy; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
124 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
125 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
126 | * A bitwise OR of flags for this participant, such as whether they |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
127 | * are a channel operator. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
128 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
129 | PurpleChatConversationBuddyFlags flags; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
130 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
131 | /** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
132 | * A hash table of attributes about the user, such as real name, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
133 | * user\@host, etc. |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
134 | */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
135 | GHashTable *attributes; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
136 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
137 | /** The UI can put whatever it wants here. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
138 | gpointer ui_data; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
139 | }; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
140 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
141 | /* Chat Buddy Property enums */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
142 | enum { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
143 | CB_PROP_0, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
144 | CB_PROP_CHAT, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
145 | CB_PROP_NAME, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
146 | CB_PROP_ALIAS, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
147 | CB_PROP_BUDDY, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
148 | CB_PROP_FLAGS, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
149 | CB_PROP_LAST |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
150 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
151 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
152 | static PurpleConversationClass *parent_class; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
153 | static GObjectClass *cb_parent_class; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
154 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
155 | static int purple_chat_conversation_buddy_compare(PurpleChatConversationBuddy *a, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
156 | PurpleChatConversationBuddy *b); |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
157 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
158 | /************************************************************************** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
159 | * IM Conversation API |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
160 | **************************************************************************/ |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
161 | static gboolean |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
162 | reset_typing_cb(gpointer data) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
163 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
164 | PurpleIMConversation *im = (PurpleIMConversation *)data; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
165 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
166 | purple_im_conversation_set_typing_state(im, PURPLE_IM_CONVERSATION_NOT_TYPING); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
167 | purple_im_conversation_stop_typing_timeout(im); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
168 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
169 | return FALSE; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
170 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
171 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
172 | static gboolean |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
173 | send_typed_cb(gpointer data) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
174 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
175 | PurpleIMConversation *im = (PurpleIMConversation *)data; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
176 | PurpleConnection *gc; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
177 | const char *name; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
178 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
179 | g_return_val_if_fail(im != NULL, FALSE); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
180 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
181 | gc = purple_conversation_get_connection(PURPLE_CONVERSATION(im)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
182 | name = purple_conversation_get_name(PURPLE_CONVERSATION(im)); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
183 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
184 | if (gc != NULL && name != NULL) { |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
185 | /* We set this to 1 so that PURPLE_IM_CONVERSATION_TYPING will be sent |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
186 | * if the Purple user types anything else. |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
187 | */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
188 | purple_im_conversation_set_type_again(im, 1); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
189 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
190 | serv_send_typing(gc, name, PURPLE_IM_CONVERSATION_TYPED); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
191 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
192 | purple_debug(PURPLE_DEBUG_MISC, "conversation", "typed...\n"); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
193 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
194 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
195 | return FALSE; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
196 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
197 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
198 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
199 | purple_im_conversation_set_icon(PurpleIMConversation *im, PurpleBuddyIcon *icon) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
200 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
201 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
202 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
203 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
204 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
205 | if (priv->icon != icon) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
206 | { |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
207 | purple_buddy_icon_unref(priv->icon); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
208 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
209 | priv->icon = (icon == NULL ? NULL : purple_buddy_icon_ref(icon)); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
210 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
211 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
212 | purple_conversation_update(PURPLE_CONVERSATION(im), |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
213 | PURPLE_CONVERSATION_UPDATE_ICON); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
214 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
215 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
216 | PurpleBuddyIcon * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
217 | purple_im_conversation_get_icon(const PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
218 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
219 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
220 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
221 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
222 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
223 | return priv->icon; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
224 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
225 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
226 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
227 | purple_im_conversation_set_typing_state(PurpleIMConversation *im, PurpleIMConversationTypingState state) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
228 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
229 | PurpleAccount *account; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
230 | const char *name; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
231 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
232 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
233 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
234 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
235 | name = purple_conversation_get_name(PURPLE_CONVERSATION(im)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
236 | account = purple_conversation_get_account(PURPLE_CONVERSATION(im)); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
237 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
238 | if (priv->typing_state != state) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
239 | { |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
240 | priv->typing_state = state; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
241 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
242 | switch (state) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
243 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
244 | case PURPLE_IM_CONVERSATION_TYPING: |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
245 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
246 | "buddy-typing", account, name); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
247 | break; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
248 | case PURPLE_IM_CONVERSATION_TYPED: |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
249 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
250 | "buddy-typed", account, name); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
251 | break; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
252 | case PURPLE_IM_CONVERSATION_NOT_TYPING: |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
253 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
254 | "buddy-typing-stopped", account, name); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
255 | break; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
256 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
257 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
258 | purple_im_conversation_update_typing(im); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
259 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
260 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
261 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
262 | PurpleIMConversationTypingState |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
263 | purple_im_conversation_get_typing_state(const PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
264 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
265 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
266 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
267 | g_return_val_if_fail(priv != NULL, 0); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
268 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
269 | return priv->typing_state; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
270 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
271 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
272 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
273 | purple_im_conversation_start_typing_timeout(PurpleIMConversation *im, int timeout) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
274 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
275 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
276 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
277 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
278 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
279 | if (priv->typing_timeout > 0) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
280 | purple_im_conversation_stop_typing_timeout(im); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
281 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
282 | priv->typing_timeout = purple_timeout_add_seconds(timeout, reset_typing_cb, im); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
283 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
284 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
285 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
286 | purple_im_conversation_stop_typing_timeout(PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
287 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
288 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
289 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
290 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
291 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
292 | if (priv->typing_timeout == 0) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
293 | return; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
294 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
295 | purple_timeout_remove(priv->typing_timeout); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
296 | priv->typing_timeout = 0; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
297 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
298 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
299 | guint |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
300 | purple_im_conversation_get_typing_timeout(const PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
301 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
302 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
303 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
304 | g_return_val_if_fail(priv != NULL, 0); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
305 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
306 | return priv->typing_timeout; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
307 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
308 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
309 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
310 | purple_im_conversation_set_type_again(PurpleIMConversation *im, unsigned int val) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
311 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
312 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
313 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
314 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
315 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
316 | if (val == 0) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
317 | priv->type_again = 0; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
318 | else |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
319 | priv->type_again = time(NULL) + val; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
320 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
321 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
322 | time_t |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
323 | purple_im_conversation_get_type_again(const PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
324 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
325 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
326 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
327 | g_return_val_if_fail(priv != NULL, 0); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
328 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
329 | return priv->type_again; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
330 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
331 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
332 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
333 | purple_im_conversation_start_send_typed_timeout(PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
334 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
335 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
336 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
337 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
338 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
339 | priv->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS, |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
340 | send_typed_cb, im); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
341 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
342 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
343 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
344 | purple_im_conversation_stop_send_typed_timeout(PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
345 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
346 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
347 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
348 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
349 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
350 | if (priv->send_typed_timeout == 0) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
351 | return; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
352 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
353 | purple_timeout_remove(priv->send_typed_timeout); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
354 | priv->send_typed_timeout = 0; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
355 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
356 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
357 | guint |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
358 | purple_im_conversation_get_send_typed_timeout(const PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
359 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
360 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
361 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
362 | g_return_val_if_fail(priv != NULL, 0); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
363 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
364 | return priv->send_typed_timeout; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
365 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
366 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
367 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
368 | purple_im_conversation_update_typing(PurpleIMConversation *im) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
369 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
370 | g_return_if_fail(im != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
371 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
372 | purple_conversation_update(PURPLE_CONVERSATION(im), |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
373 | PURPLE_CONVERSATION_UPDATE_TYPING); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
374 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
375 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
376 | static void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
377 | im_conversation_write_message(PurpleConversation *conv, const char *who, const char *message, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
378 | PurpleMessageFlags flags, time_t mtime) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
379 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
380 | PurpleConversationUiOps *ops; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
381 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
382 | g_return_if_fail(conv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
383 | g_return_if_fail(message != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
384 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
385 | ops = purple_conversation_get_ui_ops(conv); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
386 | |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
387 | if ((flags & PURPLE_MESSAGE_RECV) == PURPLE_MESSAGE_RECV) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
388 | purple_im_conversation_set_typing_state(PURPLE_IM_CONVERSATION(conv), |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
389 | PURPLE_IM_CONVERSATION_NOT_TYPING); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
390 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
391 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
392 | /* Pass this on to either the ops structure or the default write func. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
393 | if (ops != NULL && ops->write_im != NULL) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
394 | ops->write_im(PURPLE_IM_CONVERSATION(conv), who, message, flags, mtime); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
395 | else |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
396 | purple_conversation_write(conv, who, message, flags, mtime); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
397 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
398 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
399 | /************************************************************************** |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
400 | * GObject code for IMs |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
401 | **************************************************************************/ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
402 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
403 | /* GObject Property names */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
404 | #define IM_PROP_TYPING_STATE_S "typing-state" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
405 | #define IM_PROP_ICON_S "icon" |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
406 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
407 | /* Set method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
408 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
409 | purple_im_conversation_set_property(GObject *obj, guint param_id, const GValue *value, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
410 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
411 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
412 | PurpleIMConversation *im = PURPLE_IM_CONVERSATION(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
413 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
414 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
415 | case IM_PROP_TYPING_STATE: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
416 | purple_im_conversation_set_typing_state(im, g_value_get_enum(value)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
417 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
418 | case IM_PROP_ICON: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
419 | #warning TODO: change get_pointer to get_object if PurpleBuddyIcon is a GObject |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
420 | purple_im_conversation_set_icon(im, g_value_get_pointer(value)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
421 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
422 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
423 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
424 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
425 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
426 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
427 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
428 | /* Get method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
429 | static void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
430 | purple_im_conversation_get_property(GObject *obj, guint param_id, GValue *value, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
431 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
432 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
433 | PurpleIMConversation *im = PURPLE_IM_CONVERSATION(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
434 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
435 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
436 | case IM_PROP_TYPING_STATE: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
437 | g_value_set_enum(value, purple_im_conversation_get_typing_state(im)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
438 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
439 | case IM_PROP_ICON: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
440 | #warning TODO: change set_pointer to set_object if PurpleBuddyIcon is a GObject |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
441 | g_value_set_pointer(value, purple_im_conversation_get_icon(im)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
442 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
443 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
444 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
445 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
446 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
447 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
448 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
449 | /* GObject dispose function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
450 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
451 | purple_im_conversation_dispose(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
452 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
453 | PurpleIMConversation *im = PURPLE_IM_CONVERSATION(object); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
454 | PurpleConnection *gc = purple_conversation_get_connection(PURPLE_CONVERSATION(im)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
455 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
456 | const char *name = purple_conversation_get_name(PURPLE_CONVERSATION(im)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
457 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
458 | if (gc != NULL) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
459 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
460 | /* Still connected */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
461 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
462 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
463 | if (purple_prefs_get_bool("/purple/conversations/im/send_typing")) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
464 | serv_send_typing(gc, name, PURPLE_IM_CONVERSATION_NOT_TYPING); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
465 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
466 | if (gc && prpl_info->convo_closed != NULL) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
467 | prpl_info->convo_closed(gc, name); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
468 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
469 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
470 | purple_im_conversation_stop_typing_timeout(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
471 | purple_im_conversation_stop_send_typed_timeout(im); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
472 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
473 | G_OBJECT_CLASS(parent_class)->dispose(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
474 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
475 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
476 | /* GObject finalize function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
477 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
478 | purple_im_conversation_finalize(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
479 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
480 | PurpleIMConversation *im = PURPLE_IM_CONVERSATION(object); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
481 | PurpleIMConversationPrivate *priv = PURPLE_IM_CONVERSATION_GET_PRIVATE(im); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
482 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
483 | purple_buddy_icon_unref(priv->icon); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
484 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
485 | G_OBJECT_CLASS(parent_class)->finalize(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
486 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
487 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
488 | /* Class initializer function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
489 | static void purple_im_conversation_class_init(PurpleIMConversationClass *klass) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
490 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
491 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
492 | PurpleConversationClass *conv_class = PURPLE_CONVERSATION_CLASS(klass); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
493 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
494 | parent_class = g_type_class_peek_parent(klass); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
495 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
496 | obj_class->dispose = purple_im_conversation_dispose; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
497 | obj_class->finalize = purple_im_conversation_finalize; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
498 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
499 | /* Setup properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
500 | obj_class->get_property = purple_im_conversation_get_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
501 | obj_class->set_property = purple_im_conversation_set_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
502 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
503 | conv_class->write_message = im_conversation_write_message; |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
504 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
505 | g_object_class_install_property(obj_class, IM_PROP_TYPING_STATE, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
506 | g_param_spec_enum(IM_PROP_TYPING_STATE_S, _("Typing state"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
507 | _("Status of the user's typing of a message."), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
508 | PURPLE_TYPE_IM_CONVERSATION_TYPING_STATE, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
509 | PURPLE_IM_CONVERSATION_NOT_TYPING, G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
510 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
511 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
512 | #warning TODO: change spec_pointer to spec_object if PurpleBuddyIcon is a GObject |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
513 | g_object_class_install_property(obj_class, IM_PROP_ICON, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
514 | g_param_spec_pointer(IM_PROP_ICON_S, _("Buddy icon"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
515 | _("The buddy icon for the IM."), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
516 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
517 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
518 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
519 | g_type_class_add_private(klass, sizeof(PurpleIMConversationPrivate)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
520 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
521 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
522 | GType |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
523 | purple_im_conversation_get_type(void) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
524 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
525 | static GType type = 0; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
526 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
527 | if(type == 0) { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
528 | static const GTypeInfo info = { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
529 | sizeof(PurpleIMConversationClass), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
530 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
531 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
532 | (GClassInitFunc)purple_im_conversation_class_init, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
533 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
534 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
535 | sizeof(PurpleIMConversation), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
536 | 0, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
537 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
538 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
539 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
540 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
541 | type = g_type_register_static(PURPLE_TYPE_CONVERSATION, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
542 | "PurpleIMConversation", |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
543 | &info, 0); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
544 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
545 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
546 | return type; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
547 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
548 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
549 | PurpleIMConversation * |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
550 | purple_im_conversation_new(PurpleAccount *account, const char *name) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
551 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
552 | PurpleIMConversation *im; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
553 | PurpleConversation *conv; |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
554 | PurpleConnection *gc; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
555 | PurpleConversationUiOps *ops; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
556 | PurpleBuddyIcon *icon; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
557 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
558 | g_return_val_if_fail(account != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
559 | g_return_val_if_fail(name != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
560 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
561 | /* Check if this conversation already exists. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
562 | if ((im = purple_conversations_find_im_with_account(name, account)) != NULL) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
563 | return im; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
564 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
565 | gc = purple_account_get_connection(account); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
566 | g_return_val_if_fail(gc != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
567 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
568 | im = g_object_new(PURPLE_TYPE_IM_CONVERSATION, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
569 | "account", account, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
570 | "name", name, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
571 | "title", name, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
572 | NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
573 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
574 | conv = PURPLE_CONVERSATION(im); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
575 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
576 | /* copy features from the connection. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
577 | purple_conversation_set_features(conv, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
578 | purple_connection_get_flags(gc)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
579 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
580 | purple_conversations_add(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
581 | if ((icon = purple_buddy_icons_find(account, name))) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
582 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
583 | purple_im_conversation_set_icon(im, icon); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
584 | /* purple_im_conversation_set_icon refs the icon. */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
585 | purple_buddy_icon_unref(icon); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
586 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
587 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
588 | if (purple_prefs_get_bool("/purple/logging/log_ims")) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
589 | purple_conversation_set_logging(conv, TRUE); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
590 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
591 | /* Auto-set the title. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
592 | purple_conversation_autoset_title(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
593 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
594 | /* Don't move this.. it needs to be one of the last things done otherwise |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
595 | * it causes mysterious crashes on my system. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
596 | * -- Gary |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
597 | */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
598 | ops = purple_conversations_get_ui_ops(); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
599 | purple_conversation_set_ui_ops(conv, ops); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
600 | if (ops != NULL && ops->create_conversation != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
601 | ops->create_conversation(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
602 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
603 | purple_signal_emit(purple_conversations_get_handle(), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
604 | "conversation-created", im); /* TODO im-created */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
605 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
606 | return im; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
607 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
608 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
609 | /************************************************************************** |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
610 | * Chat Conversation API |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
611 | **************************************************************************/ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
612 | static guint |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
613 | _purple_conversation_user_hash(gconstpointer data) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
614 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
615 | const gchar *name = data; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
616 | gchar *collated; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
617 | guint hash; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
618 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
619 | collated = g_utf8_collate_key(name, -1); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
620 | hash = g_str_hash(collated); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
621 | g_free(collated); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
622 | return hash; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
623 | } |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
624 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
625 | static gboolean |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
626 | _purple_conversation_user_equal(gconstpointer a, gconstpointer b) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
627 | { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
628 | return !g_utf8_collate(a, b); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
629 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
630 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
631 | GList * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
632 | purple_chat_conversation_get_users(const PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
633 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
634 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
635 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
636 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
637 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
638 | return priv->in_room; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
639 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
640 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
641 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
642 | purple_chat_conversation_ignore(PurpleChatConversation *chat, const char *name) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
643 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
644 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
645 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
646 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
647 | g_return_if_fail(name != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
648 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
649 | /* Make sure the user isn't already ignored. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
650 | if (purple_chat_conversation_is_ignored_user(chat, name)) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
651 | return; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
652 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
653 | purple_chat_conversation_set_ignored(chat, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
654 | g_list_append(priv->ignored, g_strdup(name))); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
655 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
656 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
657 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
658 | purple_chat_conversation_unignore(PurpleChatConversation *chat, const char *name) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
659 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
660 | GList *item; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
661 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
662 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
663 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
664 | g_return_if_fail(name != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
665 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
666 | /* Make sure the user is actually ignored. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
667 | if (!purple_chat_conversation_is_ignored_user(chat, name)) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
668 | return; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
669 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
670 | item = g_list_find(purple_chat_conversation_get_ignored(chat), |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
671 | purple_chat_conversation_get_ignored_user(chat, name)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
672 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
673 | purple_chat_conversation_set_ignored(chat, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
674 | g_list_remove_link(priv->ignored, item)); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
675 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
676 | g_free(item->data); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
677 | g_list_free_1(item); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
678 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
679 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
680 | GList * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
681 | purple_chat_conversation_set_ignored(PurpleChatConversation *chat, GList *ignored) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
682 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
683 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
684 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
685 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
686 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
687 | priv->ignored = ignored; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
688 | return ignored; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
689 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
690 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
691 | GList * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
692 | purple_chat_conversation_get_ignored(const PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
693 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
694 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
695 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
696 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
697 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
698 | return priv->ignored; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
699 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
700 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
701 | const char * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
702 | purple_chat_conversation_get_ignored_user(const PurpleChatConversation *chat, const char *user) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
703 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
704 | GList *ignored; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
705 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
706 | g_return_val_if_fail(chat != NULL, NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
707 | g_return_val_if_fail(user != NULL, NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
708 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
709 | for (ignored = purple_chat_conversation_get_ignored(chat); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
710 | ignored != NULL; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
711 | ignored = ignored->next) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
712 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
713 | const char *ign = (const char *)ignored->data; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
714 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
715 | if (!purple_utf8_strcasecmp(user, ign) || |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
716 | ((*ign == '+' || *ign == '%') && !purple_utf8_strcasecmp(user, ign + 1))) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
717 | return ign; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
718 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
719 | if (*ign == '@') { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
720 | ign++; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
721 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
722 | if ((*ign == '+' && !purple_utf8_strcasecmp(user, ign + 1)) || |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
723 | (*ign != '+' && !purple_utf8_strcasecmp(user, ign))) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
724 | return ign; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
725 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
726 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
727 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
728 | return NULL; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
729 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
730 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
731 | gboolean |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
732 | purple_chat_conversation_is_ignored_user(const PurpleChatConversation *chat, const char *user) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
733 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
734 | g_return_val_if_fail(chat != NULL, FALSE); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
735 | g_return_val_if_fail(user != NULL, FALSE); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
736 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
737 | return (purple_chat_conversation_get_ignored_user(chat, user) != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
738 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
739 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
740 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
741 | purple_chat_conversation_set_topic(PurpleChatConversation *chat, const char *who, const char *topic) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
742 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
743 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
744 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
745 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
746 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
747 | g_free(priv->who); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
748 | g_free(priv->topic); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
749 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
750 | priv->who = g_strdup(who); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
751 | priv->topic = g_strdup(topic); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
752 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
753 | purple_conversation_update(PURPLE_CONVERSATION(chat), |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
754 | PURPLE_CONVERSATION_UPDATE_TOPIC); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
755 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
756 | purple_signal_emit(purple_conversations_get_handle(), "chat-topic-changed", |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
757 | chat, priv->who, priv->topic); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
758 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
759 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
760 | const char * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
761 | purple_chat_conversation_get_topic(const PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
762 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
763 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
764 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
765 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
766 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
767 | return priv->topic; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
768 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
769 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
770 | const char * |
|
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
771 | purple_chat_conversation_get_topic_who(const PurpleChatConversation *chat) |
|
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
772 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
773 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
774 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
775 | g_return_val_if_fail(priv != NULL, NULL); |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
776 | |
|
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
777 | return priv->who; |
|
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
778 | } |
|
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
779 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
780 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
781 | purple_chat_conversation_set_id(PurpleChatConversation *chat, int id) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
782 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
783 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
784 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
785 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
786 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
787 | priv->id = id; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
788 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
789 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
790 | int |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
791 | purple_chat_conversation_get_id(const PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
792 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
793 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
794 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
795 | g_return_val_if_fail(priv != NULL, -1); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
796 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
797 | return priv->id; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
798 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
799 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
800 | static void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
801 | chat_conversation_write_message(PurpleConversation *conv, const char *who, const char *message, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
802 | PurpleMessageFlags flags, time_t mtime) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
803 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
804 | PurpleAccount *account; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
805 | PurpleConversationUiOps *ops; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
806 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(conv); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
807 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
808 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
809 | g_return_if_fail(who != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
810 | g_return_if_fail(message != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
811 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
812 | account = purple_conversation_get_account(conv); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
813 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
814 | /* Don't display this if the person who wrote it is ignored. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
815 | if (purple_chat_conversation_is_ignored_user(PURPLE_CHAT_CONVERSATION(conv), who)) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
816 | return; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
817 | |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
818 | if (!(flags & PURPLE_MESSAGE_WHISPER)) { |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
819 | const char *str; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
820 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
821 | str = purple_normalize(account, who); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
822 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
823 | if (purple_strequal(str, priv->nick)) { |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
824 | flags |= PURPLE_MESSAGE_SEND; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
825 | } else { |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
826 | flags |= PURPLE_MESSAGE_RECV; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
827 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
828 | if (purple_utf8_has_word(message, priv->nick)) |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
829 | flags |= PURPLE_MESSAGE_NICK; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
830 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
831 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
832 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
833 | ops = purple_conversation_get_ui_ops(conv); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
834 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
835 | /* Pass this on to either the ops structure or the default write func. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
836 | if (ops != NULL && ops->write_chat != NULL) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
837 | ops->write_chat(PURPLE_CHAT_CONVERSATION(conv), who, message, flags, mtime); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
838 | else |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
839 | purple_conversation_write(conv, who, message, flags, mtime); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
840 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
841 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
842 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
843 | purple_chat_conversation_add_user(PurpleChatConversation *chat, const char *user, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
844 | const char *extra_msg, PurpleChatConversationBuddyFlags flags, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
845 | gboolean new_arrival) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
846 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
847 | GList *users = g_list_append(NULL, (char *)user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
848 | GList *extra_msgs = g_list_append(NULL, (char *)extra_msg); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
849 | GList *flags2 = g_list_append(NULL, GINT_TO_POINTER(flags)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
850 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
851 | purple_chat_conversation_add_users(chat, users, extra_msgs, flags2, new_arrival); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
852 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
853 | g_list_free(users); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
854 | g_list_free(extra_msgs); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
855 | g_list_free(flags2); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
856 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
857 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
858 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
859 | purple_chat_conversation_add_users(PurpleChatConversation *chat, GList *users, GList *extra_msgs, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
860 | GList *flags, gboolean new_arrivals) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
861 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
862 | PurpleConversation *conv; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
863 | PurpleConversationUiOps *ops; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
864 | PurpleChatConversationBuddy *cbuddy; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
865 | PurpleChatConversationPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
866 | PurpleAccount *account; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
867 | PurpleConnection *gc; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
868 | PurplePluginProtocolInfo *prpl_info; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
869 | GList *ul, *fl; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
870 | GList *cbuddies = NULL; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
871 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
872 | priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
873 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
874 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
875 | g_return_if_fail(users != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
876 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
877 | conv = PURPLE_CONVERSATION(chat); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
878 | ops = purple_conversation_get_ui_ops(conv); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
879 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
880 | account = purple_conversation_get_account(conv); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
881 | gc = purple_conversation_get_connection(conv); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
882 | g_return_if_fail(gc != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
883 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
884 | g_return_if_fail(prpl_info != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
885 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
886 | ul = users; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
887 | fl = flags; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
888 | while ((ul != NULL) && (fl != NULL)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
889 | const char *user = (const char *)ul->data; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
890 | const char *alias = user; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
891 | gboolean quiet; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
892 | PurpleChatConversationBuddyFlags flag = GPOINTER_TO_INT(fl->data); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
893 | const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
894 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
895 | if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
896 | if (purple_strequal(priv->nick, purple_normalize(account, user))) { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
897 | const char *alias2 = purple_account_get_private_alias(account); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
898 | if (alias2 != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
899 | alias = alias2; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
900 | else |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
901 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
902 | const char *display_name = purple_connection_get_display_name(gc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
903 | if (display_name != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
904 | alias = display_name; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
905 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
906 | } else { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
907 | PurpleBuddy *buddy; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
908 | if ((buddy = purple_find_buddy(purple_connection_get_account(gc), user)) != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
909 | alias = purple_buddy_get_contact_alias(buddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
910 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
911 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
912 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
913 | quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
914 | "chat-buddy-joining", chat, user, flag)) || |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
915 | purple_chat_conversation_is_ignored_user(chat, user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
916 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
917 | cbuddy = purple_chat_conversation_buddy_new(chat, user, alias, flag); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
918 | purple_chat_conversation_buddy_set_buddy(cbuddy, purple_find_buddy(account, user) != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
919 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
920 | priv->in_room = g_list_prepend(priv->in_room, cbuddy); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
921 | g_hash_table_replace(priv->users, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
922 | g_strdup(purple_chat_conversation_buddy_get_name(cbuddy)), cbuddy); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
923 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
924 | cbuddies = g_list_prepend(cbuddies, cbuddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
925 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
926 | if (!quiet && new_arrivals) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
927 | char *alias_esc = g_markup_escape_text(alias, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
928 | char *tmp; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
929 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
930 | if (extra_msg == NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
931 | tmp = g_strdup_printf(_("%s entered the room."), alias_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
932 | else { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
933 | char *extra_msg_esc = g_markup_escape_text(extra_msg, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
934 | tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."), |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
935 | alias_esc, extra_msg_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
936 | g_free(extra_msg_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
937 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
938 | g_free(alias_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
939 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
940 | purple_conversation_write(conv, NULL, tmp, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
941 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
942 | time(NULL)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
943 | g_free(tmp); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
944 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
945 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
946 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
947 | "chat-buddy-joined", chat, user, flag, new_arrivals); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
948 | ul = ul->next; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
949 | fl = fl->next; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
950 | if (extra_msgs != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
951 | extra_msgs = extra_msgs->next; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
952 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
953 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
954 | cbuddies = g_list_sort(cbuddies, (GCompareFunc)purple_chat_conversation_buddy_compare); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
955 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
956 | if (ops != NULL && ops->chat_add_users != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
957 | ops->chat_add_users(chat, cbuddies, new_arrivals); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
958 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
959 | g_list_free(cbuddies); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
960 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
961 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
962 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
963 | purple_chat_conversation_rename_user(PurpleChatConversation *chat, const char *old_user, |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
964 | const char *new_user) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
965 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
966 | PurpleConversation *conv; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
967 | PurpleConversationUiOps *ops; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
968 | PurpleAccount *account; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
969 | PurpleConnection *gc; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
970 | PurplePluginProtocolInfo *prpl_info; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
971 | PurpleChatConversationBuddy *cb; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
972 | PurpleChatConversationBuddyFlags flags; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
973 | PurpleChatConversationPrivate *priv; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
974 | const char *new_alias = new_user; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
975 | char tmp[BUF_LONG]; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
976 | gboolean is_me = FALSE; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
977 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
978 | priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
979 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
980 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
981 | g_return_if_fail(old_user != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
982 | g_return_if_fail(new_user != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
983 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
984 | conv = PURPLE_CONVERSATION(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
985 | ops = purple_conversation_get_ui_ops(conv); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
986 | account = purple_conversation_get_account(conv); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
987 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
988 | gc = purple_conversation_get_connection(conv); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
989 | g_return_if_fail(gc != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
990 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
991 | g_return_if_fail(prpl_info != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
992 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
993 | if (purple_strequal(priv->nick, purple_normalize(account, old_user))) { |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
994 | const char *alias; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
995 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
996 | /* Note this for later. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
997 | is_me = TRUE; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
998 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
999 | if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1000 | alias = purple_account_get_private_alias(account); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1001 | if (alias != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1002 | new_alias = alias; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1003 | else |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1004 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1005 | const char *display_name = purple_connection_get_display_name(gc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1006 | if (display_name != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1007 | new_alias = display_name; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1008 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1009 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1010 | } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1011 | PurpleBuddy *buddy; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1012 | if ((buddy = purple_find_buddy(purple_connection_get_account(gc), new_user)) != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1013 | new_alias = purple_buddy_get_contact_alias(buddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1014 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1015 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1016 | flags = purple_chat_conversation_buddy_get_flags(purple_chat_conversation_find_buddy(chat, old_user)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1017 | cb = purple_chat_conversation_buddy_new(chat, new_user, new_alias, flags); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1018 | purple_chat_conversation_buddy_set_buddy(cb, purple_find_buddy(account, new_user) != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1019 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1020 | priv->in_room = g_list_prepend(priv->in_room, cb); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1021 | g_hash_table_replace(priv->users, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1022 | g_strdup(purple_chat_conversation_buddy_get_name(cb)), cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1023 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1024 | if (ops != NULL && ops->chat_rename_user != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1025 | ops->chat_rename_user(chat, old_user, new_user, new_alias); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1026 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1027 | cb = purple_chat_conversation_find_buddy(chat, old_user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1028 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1029 | if (cb) { |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1030 | priv->in_room = g_list_remove(priv->in_room, cb); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1031 | g_hash_table_remove(priv->users, purple_chat_conversation_buddy_get_name(cb)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1032 | g_object_unref(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1033 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1034 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1035 | if (purple_chat_conversation_is_ignored_user(chat, old_user)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1036 | purple_chat_conversation_unignore(chat, old_user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1037 | purple_chat_conversation_ignore(chat, new_user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1038 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1039 | else if (purple_chat_conversation_is_ignored_user(chat, new_user)) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1040 | purple_chat_conversation_unignore(chat, new_user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1041 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1042 | if (is_me) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1043 | purple_chat_conversation_set_nick(chat, new_user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1044 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1045 | if (purple_prefs_get_bool("/purple/conversations/chat/show_nick_change") && |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1046 | !purple_chat_conversation_is_ignored_user(chat, new_user)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1047 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1048 | if (is_me) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1049 | char *escaped = g_markup_escape_text(new_user, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1050 | g_snprintf(tmp, sizeof(tmp), |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1051 | _("You are now known as %s"), escaped); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1052 | g_free(escaped); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1053 | } else { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1054 | const char *old_alias = old_user; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1055 | const char *new_alias = new_user; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1056 | char *escaped; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1057 | char *escaped2; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1058 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1059 | if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1060 | PurpleBuddy *buddy; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1061 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1062 | if ((buddy = purple_find_buddy(purple_connection_get_account(gc), old_user)) != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1063 | old_alias = purple_buddy_get_contact_alias(buddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1064 | if ((buddy = purple_find_buddy(purple_connection_get_account(gc), new_user)) != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1065 | new_alias = purple_buddy_get_contact_alias(buddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1066 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1067 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1068 | escaped = g_markup_escape_text(old_alias, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1069 | escaped2 = g_markup_escape_text(new_alias, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1070 | g_snprintf(tmp, sizeof(tmp), |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1071 | _("%s is now known as %s"), escaped, escaped2); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1072 | g_free(escaped); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1073 | g_free(escaped2); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1074 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1075 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1076 | purple_conversation_write(conv, NULL, tmp, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
1077 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1078 | time(NULL)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1079 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1080 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1081 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1082 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1083 | purple_chat_conversation_remove_user(PurpleChatConversation *chat, const char *user, const char *reason) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1084 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1085 | GList *users = g_list_append(NULL, (char *)user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1086 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1087 | purple_chat_conversation_remove_users(chat, users, reason); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1088 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1089 | g_list_free(users); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1090 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1091 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1092 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1093 | purple_chat_conversation_remove_users(PurpleChatConversation *chat, GList *users, const char *reason) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1094 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1095 | PurpleConversation *conv; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1096 | PurpleConnection *gc; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1097 | PurplePluginProtocolInfo *prpl_info; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1098 | PurpleConversationUiOps *ops; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1099 | PurpleChatConversationBuddy *cb; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1100 | PurpleChatConversationPrivate *priv; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1101 | GList *l; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1102 | gboolean quiet; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1103 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1104 | priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1105 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1106 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1107 | g_return_if_fail(users != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1108 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1109 | conv = PURPLE_CONVERSATION(chat); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1110 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1111 | gc = purple_conversation_get_connection(conv); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1112 | g_return_if_fail(gc != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1113 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1114 | g_return_if_fail(prpl_info != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1115 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1116 | ops = purple_conversation_get_ui_ops(conv); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1117 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1118 | for (l = users; l != NULL; l = l->next) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1119 | const char *user = (const char *)l->data; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1120 | quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1121 | "chat-buddy-leaving", chat, user, reason)) | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1122 | purple_chat_conversation_is_ignored_user(chat, user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1123 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1124 | cb = purple_chat_conversation_find_buddy(chat, user); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1125 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1126 | if (cb) { |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1127 | priv->in_room = g_list_remove(priv->in_room, cb); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1128 | g_hash_table_remove(priv->users, purple_chat_conversation_buddy_get_name(cb)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1129 | g_object_unref(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1130 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1131 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1132 | /* NOTE: Don't remove them from ignored in case they re-enter. */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1133 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1134 | if (!quiet) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1135 | const char *alias = user; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1136 | char *alias_esc; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1137 | char *tmp; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1138 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1139 | if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1140 | PurpleBuddy *buddy; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1141 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1142 | if ((buddy = purple_find_buddy(purple_connection_get_account(gc), user)) != NULL) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1143 | alias = purple_buddy_get_contact_alias(buddy); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1144 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1145 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1146 | alias_esc = g_markup_escape_text(alias, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1147 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1148 | if (reason == NULL || !*reason) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1149 | tmp = g_strdup_printf(_("%s left the room."), alias_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1150 | else { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1151 | char *reason_esc = g_markup_escape_text(reason, -1); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1152 | tmp = g_strdup_printf(_("%s left the room (%s)."), |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1153 | alias_esc, reason_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1154 | g_free(reason_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1155 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1156 | g_free(alias_esc); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1157 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1158 | purple_conversation_write(conv, NULL, tmp, |
|
34620
e49aa67344e1
Renamed PurpleConversationMessageFlags back to PurpleMessageFlags.
Ankit Vani <a@nevitus.org>
parents:
34602
diff
changeset
|
1159 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1160 | time(NULL)); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1161 | g_free(tmp); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1162 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1163 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1164 | purple_signal_emit(purple_conversations_get_handle(), "chat-buddy-left", |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1165 | conv, user, reason); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1166 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1167 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1168 | if (ops != NULL && ops->chat_remove_users != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1169 | ops->chat_remove_users(chat, users); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1170 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1171 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1172 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1173 | purple_chat_conversation_clear_users(PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1174 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1175 | PurpleConversationUiOps *ops; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1176 | GList *users; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1177 | GList *l; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1178 | GList *names = NULL; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1179 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1180 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1181 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1182 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1183 | ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1184 | users = priv->in_room; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1185 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1186 | if (ops != NULL && ops->chat_remove_users != NULL) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1187 | for (l = users; l; l = l->next) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1188 | PurpleChatConversationBuddy *cb = l->data; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1189 | names = g_list_prepend(names, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1190 | (gchar *) purple_chat_conversation_buddy_get_name(cb)); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1191 | } |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1192 | ops->chat_remove_users(chat, names); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1193 | g_list_free(names); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1194 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1195 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1196 | for (l = users; l; l = l->next) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1197 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1198 | PurpleChatConversationBuddy *cb = l->data; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1199 | const char *name = purple_chat_conversation_buddy_get_name(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1200 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1201 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1202 | "chat-buddy-leaving", chat, name, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1203 | purple_signal_emit(purple_conversations_get_handle(), |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1204 | "chat-buddy-left", chat, name, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1205 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1206 | g_object_unref(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1207 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1208 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1209 | g_hash_table_remove_all(priv->users); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1210 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1211 | g_list_free(users); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1212 | priv->in_room = NULL; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1213 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1214 | |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1215 | void purple_chat_conversation_set_nick(PurpleChatConversation *chat, const char *nick) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1216 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1217 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1218 | g_return_if_fail(priv != NULL); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1219 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1220 | g_free(priv->nick); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1221 | priv->nick = g_strdup(purple_normalize( |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1222 | purple_conversation_get_account(PURPLE_CONVERSATION(chat)), nick)); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1223 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1224 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1225 | const char *purple_chat_conversation_get_nick(PurpleChatConversation *chat) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1226 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1227 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1228 | g_return_val_if_fail(priv != NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1229 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1230 | return priv->nick; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1231 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1232 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1233 | static void |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1234 | invite_user_to_chat(gpointer data, PurpleRequestFields *fields) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1235 | { |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1236 | PurpleConversation *conv; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1237 | PurpleChatConversationPrivate *priv; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1238 | const char *user, *message; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1239 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1240 | conv = data; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1241 | priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(conv); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1242 | user = purple_request_fields_get_string(fields, "screenname"); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1243 | message = purple_request_fields_get_string(fields, "message"); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1244 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1245 | serv_chat_invite(purple_conversation_get_connection(conv), priv->id, message, user); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1246 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1247 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1248 | void purple_chat_conversation_invite_user(PurpleChatConversation *chat, const char *user, |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1249 | const char *message, gboolean confirm) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1250 | { |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1251 | PurpleAccount *account; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1252 | PurpleRequestFields *fields; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1253 | PurpleRequestFieldGroup *group; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1254 | PurpleRequestField *field; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1255 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1256 | g_return_if_fail(chat != NULL); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1257 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1258 | if (!user || !*user || !message || !*message) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1259 | confirm = TRUE; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1260 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1261 | account = purple_conversation_get_account(PURPLE_CONVERSATION(chat)); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1262 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1263 | if (!confirm) { |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1264 | serv_chat_invite(purple_account_get_connection(account), |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1265 | purple_chat_conversation_get_id(chat), message, user); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1266 | return; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1267 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1268 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1269 | fields = purple_request_fields_new(); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1270 | group = purple_request_field_group_new(_("Invite to chat")); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1271 | purple_request_fields_add_group(fields, group); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1272 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1273 | field = purple_request_field_string_new("screenname", _("Buddy"), user, FALSE); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1274 | purple_request_field_group_add_field(group, field); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1275 | purple_request_field_set_required(field, TRUE); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1276 | purple_request_field_set_type_hint(field, "screenname"); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1277 | |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1278 | field = purple_request_field_string_new("message", _("Message"), message, FALSE); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1279 | purple_request_field_group_add_field(group, field); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1280 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1281 | purple_request_fields(chat, _("Invite to chat"), NULL, |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1282 | _("Please enter the name of the user you wish to invite, " |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1283 | "along with an optional invite message."), |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1284 | fields, |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1285 | _("Invite"), G_CALLBACK(invite_user_to_chat), |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1286 | _("Cancel"), NULL, |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1287 | account, user, PURPLE_CONVERSATION(chat), |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1288 | chat); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1289 | } |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1290 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1291 | gboolean |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1292 | purple_chat_conversation_has_user(PurpleChatConversation *chat, const char *user) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1293 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1294 | g_return_val_if_fail(chat != NULL, FALSE); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1295 | g_return_val_if_fail(user != NULL, FALSE); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1296 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1297 | return (purple_chat_conversation_find_buddy(chat, user) != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1298 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1299 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1300 | void |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1301 | purple_chat_conversation_leave(PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1302 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1303 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1304 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1305 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1306 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1307 | priv->left = TRUE; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1308 | purple_conversation_update(PURPLE_CONVERSATION(chat), PURPLE_CONVERSATION_UPDATE_CHATLEFT); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1309 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1310 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1311 | gboolean |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1312 | purple_chat_conversation_has_left(PurpleChatConversation *chat) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1313 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1314 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1315 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1316 | g_return_val_if_fail(priv != NULL, TRUE); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1317 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1318 | return priv->left; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1319 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1320 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1321 | static void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1322 | chat_conversation_cleanup_for_rejoin(PurpleChatConversation *chat) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1323 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1324 | const char *disp; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1325 | PurpleAccount *account; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1326 | PurpleConnection *gc; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1327 | PurpleConversation *conv = PURPLE_CONVERSATION(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1328 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1329 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1330 | account = purple_conversation_get_account(conv); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1331 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1332 | purple_conversation_close_logs(conv); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1333 | purple_conversation_set_logging(conv, TRUE); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1334 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1335 | gc = purple_account_get_connection(account); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1336 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1337 | if ((disp = purple_connection_get_display_name(gc)) != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1338 | purple_chat_conversation_set_nick(chat, disp); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1339 | else |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1340 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1341 | purple_chat_conversation_set_nick(chat, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1342 | purple_account_get_username(account)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1343 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1344 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1345 | purple_chat_conversation_clear_users(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1346 | purple_chat_conversation_set_topic(chat, NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1347 | priv->left = FALSE; |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1348 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1349 | purple_conversation_update(conv, PURPLE_CONVERSATION_UPDATE_CHATLEFT); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1350 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1351 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1352 | PurpleChatConversationBuddy * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1353 | purple_chat_conversation_find_buddy(PurpleChatConversation *chat, const char *name) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1354 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1355 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1356 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1357 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1358 | g_return_val_if_fail(name != NULL, NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1359 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1360 | return g_hash_table_lookup(priv->users, name); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1361 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1362 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1363 | /************************************************************************** |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1364 | * GObject code for chats |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1365 | **************************************************************************/ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1366 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1367 | /* GObject Property names */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1368 | #define CHAT_PROP_TOPIC_WHO_S "topic-who" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1369 | #define CHAT_PROP_TOPIC_S "topic" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1370 | #define CHAT_PROP_ID_S "chat-id" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1371 | #define CHAT_PROP_NICK_S "nick" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1372 | #define CHAT_PROP_LEFT_S "left" |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1373 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1374 | /* Set method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1375 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1376 | purple_chat_conversation_set_property(GObject *obj, guint param_id, const GValue *value, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1377 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1378 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1379 | PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1380 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1381 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1382 | case CHAT_PROP_ID: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1383 | purple_chat_conversation_set_id(chat, g_value_get_int(value)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1384 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1385 | case CHAT_PROP_NICK: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1386 | purple_chat_conversation_set_nick(chat, g_value_get_string(value)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1387 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1388 | case CHAT_PROP_LEFT: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1389 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1390 | gboolean left = g_value_get_boolean(value); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1391 | if (left == TRUE) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1392 | purple_chat_conversation_leave(chat); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1393 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1394 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1395 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1396 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1397 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1398 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1399 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1400 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1401 | /* Get method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1402 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1403 | purple_chat_conversation_get_property(GObject *obj, guint param_id, GValue *value, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1404 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1405 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1406 | PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1407 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1408 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1409 | case CHAT_PROP_TOPIC_WHO: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1410 | g_value_set_string(value, purple_chat_conversation_get_topic_who(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1411 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1412 | case CHAT_PROP_TOPIC: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1413 | g_value_set_string(value, purple_chat_conversation_get_topic(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1414 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1415 | case CHAT_PROP_ID: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1416 | g_value_set_int(value, purple_chat_conversation_get_id(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1417 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1418 | case CHAT_PROP_NICK: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1419 | g_value_set_string(value, purple_chat_conversation_get_nick(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1420 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1421 | case CHAT_PROP_LEFT: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1422 | g_value_set_boolean(value, purple_chat_conversation_has_left(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1423 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1424 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1425 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1426 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1427 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1428 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1429 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1430 | /* GObject initialization function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1431 | static void purple_chat_conversation_init(GTypeInstance *instance, gpointer klass) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1432 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1433 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(instance); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1434 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1435 | priv->users = g_hash_table_new_full(_purple_conversation_user_hash, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1436 | _purple_conversation_user_equal, g_free, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1437 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1438 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1439 | /* GObject dispose function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1440 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1441 | purple_chat_conversation_dispose(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1442 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1443 | PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(object); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1444 | PurpleConnection *gc = purple_conversation_get_connection(PURPLE_CONVERSATION(chat)); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1445 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1446 | if (gc != NULL) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1447 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1448 | /* Still connected */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1449 | int chat_id = purple_chat_conversation_get_id(chat); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1450 | #if 0 |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1451 | /* |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1452 | * This is unfortunately necessary, because calling |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1453 | * serv_chat_leave() calls this purple_conversation_destroy(), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1454 | * which leads to two calls here.. We can't just return after |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1455 | * this, because then it'll return on the next pass. So, since |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1456 | * serv_got_chat_left(), which is eventually called from the |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1457 | * prpl that serv_chat_leave() calls, removes this conversation |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1458 | * from the gc's buddy_chats list, we're going to check to see |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1459 | * if this exists in the list. If so, we want to return after |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1460 | * calling this, because it'll be called again. If not, fall |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1461 | * through, because it'll have already been removed, and we'd |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1462 | * be on the 2nd pass. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1463 | * |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1464 | * Long paragraph. <-- Short sentence. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1465 | * |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1466 | * -- ChipX86 |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1467 | */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1468 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1469 | if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1470 | serv_chat_leave(gc, chat_id); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1471 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1472 | return; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1473 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1474 | #endif |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1475 | /* |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1476 | * Instead of all of that, lets just close the window when |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1477 | * the user tells us to, and let the prpl deal with the |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1478 | * internals on it's own time. Don't do this if the prpl already |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1479 | * knows it left the chat. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1480 | */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1481 | if (!purple_chat_conversation_has_left(chat)) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1482 | serv_chat_leave(gc, chat_id); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1483 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1484 | /* |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1485 | * If they didn't call serv_got_chat_left by now, it's too late. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1486 | * So we better do it for them before we destroy the thing. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1487 | */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1488 | if (!purple_chat_conversation_has_left(chat)) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1489 | serv_got_chat_left(gc, chat_id); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1490 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1491 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
1492 | G_OBJECT_CLASS(parent_class)->dispose(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1493 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1494 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1495 | /* GObject finalize function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1496 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1497 | purple_chat_conversation_finalize(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1498 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1499 | PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(object); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1500 | PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(chat); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1501 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1502 | g_hash_table_destroy(priv->users); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1503 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1504 | g_list_foreach(priv->in_room, (GFunc)g_object_unref, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1505 | g_list_free(priv->in_room); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1506 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1507 | g_list_foreach(priv->ignored, (GFunc)g_free, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1508 | g_list_free(priv->ignored); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1509 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1510 | g_free(priv->who); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1511 | g_free(priv->topic); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1512 | g_free(priv->nick); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1513 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
1514 | G_OBJECT_CLASS(parent_class)->finalize(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1515 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1516 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1517 | /* Class initializer function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1518 | static void purple_chat_conversation_class_init(PurpleChatConversationClass *klass) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1519 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1520 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
1521 | PurpleConversationClass *conv_class = PURPLE_CONVERSATION_CLASS(klass); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1522 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
1523 | parent_class = g_type_class_peek_parent(klass); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1524 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1525 | obj_class->dispose = purple_chat_conversation_dispose; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1526 | obj_class->finalize = purple_chat_conversation_finalize; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1527 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1528 | /* Setup properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1529 | obj_class->get_property = purple_chat_conversation_get_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1530 | obj_class->set_property = purple_chat_conversation_set_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1531 | |
|
34664
45ba05a4bb3b
Used the correct class to override write_message conversation method
Ankit Vani <a@nevitus.org>
parents:
34663
diff
changeset
|
1532 | conv_class->write_message = chat_conversation_write_message; |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
1533 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1534 | g_object_class_install_property(obj_class, CHAT_PROP_TOPIC_WHO, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1535 | g_param_spec_string(CHAT_PROP_TOPIC_WHO_S, _("Who set topic"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1536 | _("Who set the chat topic."), NULL, |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1537 | G_PARAM_READABLE) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1538 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1539 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1540 | g_object_class_install_property(obj_class, CHAT_PROP_TOPIC, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1541 | g_param_spec_string(CHAT_PROP_TOPIC_S, _("Topic"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1542 | _("Topic of the chat."), NULL, |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1543 | G_PARAM_READABLE) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1544 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1545 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1546 | g_object_class_install_property(obj_class, CHAT_PROP_ID, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1547 | g_param_spec_int(CHAT_PROP_ID_S, _("Chat ID"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1548 | _("The ID of the chat."), G_MININT, G_MAXINT, 0, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1549 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1550 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1551 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1552 | g_object_class_install_property(obj_class, CHAT_PROP_NICK, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1553 | g_param_spec_string(CHAT_PROP_NICK_S, _("Nickname"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1554 | _("The nickname of the user in a chat."), NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1555 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1556 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1557 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1558 | g_object_class_install_property(obj_class, CHAT_PROP_LEFT, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1559 | g_param_spec_boolean(CHAT_PROP_LEFT_S, _("Left the chat"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1560 | _("Whether the user has left the chat."), FALSE, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1561 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1562 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1563 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1564 | g_type_class_add_private(klass, sizeof(PurpleChatConversationPrivate)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1565 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1566 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1567 | GType |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1568 | purple_chat_conversation_get_type(void) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1569 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1570 | static GType type = 0; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1571 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1572 | if(type == 0) { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1573 | static const GTypeInfo info = { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1574 | sizeof(PurpleChatConversationClass), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1575 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1576 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1577 | (GClassInitFunc)purple_chat_conversation_class_init, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1578 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1579 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1580 | sizeof(PurpleChatConversation), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1581 | 0, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1582 | (GInstanceInitFunc)purple_chat_conversation_init, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1583 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1584 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1585 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1586 | type = g_type_register_static(PURPLE_TYPE_CONVERSATION, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1587 | "PurpleChatConversation", |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1588 | &info, 0); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1589 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1590 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1591 | return type; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1592 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1593 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1594 | PurpleChatConversation * |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1595 | purple_chat_conversation_new(PurpleAccount *account, const char *name) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1596 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1597 | PurpleChatConversation *chat; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1598 | PurpleConversation *conv; |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1599 | PurpleConnection *gc; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1600 | PurpleConversationUiOps *ops; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1601 | const char *disp; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1602 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1603 | g_return_val_if_fail(account != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1604 | g_return_val_if_fail(name != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1605 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1606 | /* Check if this conversation already exists. */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1607 | if ((chat = purple_conversations_find_chat_with_account(name, account)) != NULL) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1608 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1609 | if (!purple_chat_conversation_has_left(chat)) { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1610 | purple_debug_warning("conversation", "Trying to create multiple " |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1611 | "chats (%s) with the same name is deprecated and will be " |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1612 | "removed in libpurple 3.0.0", name); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1613 | } else { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1614 | /* |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1615 | * This hack is necessary because some prpls (MSN) have unnamed chats |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1616 | * that all use the same name. A PurpleConversation for one of those |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1617 | * is only ever re-used if the user has left, so calls to |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1618 | * purple_conversation_new need to fall-through to creating a new |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1619 | * chat. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1620 | * TODO 3.0.0: Remove this workaround and mandate unique names. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1621 | */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1622 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1623 | chat_conversation_cleanup_for_rejoin(chat); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1624 | return chat; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1625 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1626 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1627 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1628 | gc = purple_account_get_connection(account); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1629 | g_return_val_if_fail(gc != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1630 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1631 | chat = g_object_new(PURPLE_TYPE_CHAT_CONVERSATION, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1632 | "account", account, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1633 | "name", name, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1634 | "title", name, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1635 | NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1636 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1637 | conv = PURPLE_CONVERSATION(chat); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1638 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1639 | /* copy features from the connection. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1640 | purple_conversation_set_features(conv, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1641 | purple_connection_get_flags(gc)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1642 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1643 | purple_conversations_add(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1644 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1645 | if ((disp = purple_connection_get_display_name(purple_account_get_connection(account)))) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1646 | purple_chat_conversation_set_nick(chat, disp); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1647 | else |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1648 | purple_chat_conversation_set_nick(chat, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1649 | purple_account_get_username(account)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1650 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1651 | if (purple_prefs_get_bool("/purple/logging/log_chats")) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1652 | purple_conversation_set_logging(conv, TRUE); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1653 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1654 | /* Auto-set the title. */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1655 | purple_conversation_autoset_title(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1656 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1657 | /* Don't move this.. it needs to be one of the last things done otherwise |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1658 | * it causes mysterious crashes on my system. |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1659 | * -- Gary |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1660 | */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1661 | ops = purple_conversations_get_ui_ops(); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1662 | purple_conversation_set_ui_ops(PURPLE_CONVERSATION(chat), ops); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1663 | if (ops != NULL && ops->create_conversation != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1664 | ops->create_conversation(conv); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1665 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1666 | purple_signal_emit(purple_conversations_get_handle(), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1667 | "conversation-created", chat); /* TODO chat-created */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1668 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1669 | return chat; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1670 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1671 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1672 | /************************************************************************** |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1673 | * Chat Conversation Buddy API |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1674 | **************************************************************************/ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1675 | static int |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1676 | purple_chat_conversation_buddy_compare(PurpleChatConversationBuddy *a, PurpleChatConversationBuddy *b) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1677 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1678 | PurpleChatConversationBuddyFlags f1 = 0, f2 = 0; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1679 | PurpleChatConversationBuddyPrivate *priva, *privb; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1680 | char *user1 = NULL, *user2 = NULL; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1681 | gint ret = 0; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1682 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1683 | priva = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(a); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1684 | privb = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(b); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1685 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1686 | if (priva) { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1687 | f1 = priva->flags; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1688 | if (priva->alias_key) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1689 | user1 = priva->alias_key; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1690 | else if (priva->name) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1691 | user1 = priva->name; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1692 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1693 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1694 | if (privb) { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1695 | f2 = privb->flags; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1696 | if (privb->alias_key) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1697 | user2 = privb->alias_key; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1698 | else if (privb->name) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1699 | user2 = privb->name; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1700 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1701 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1702 | if (user1 == NULL || user2 == NULL) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1703 | if (!(user1 == NULL && user2 == NULL)) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1704 | ret = (user1 == NULL) ? -1: 1; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1705 | } else if (f1 != f2) { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1706 | /* sort more important users first */ |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1707 | ret = (f1 > f2) ? -1 : 1; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1708 | } else if (priva->buddy != privb->buddy) { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1709 | ret = priva->buddy ? -1 : 1; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1710 | } else { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1711 | ret = purple_utf8_strcasecmp(user1, user2); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1712 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1713 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1714 | return ret; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1715 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1716 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1717 | const char * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1718 | purple_chat_conversation_buddy_get_alias(const PurpleChatConversationBuddy *cb) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1719 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1720 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1721 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1722 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1723 | g_return_val_if_fail(priv != NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1724 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1725 | return priv->alias; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1726 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1727 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1728 | const char * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1729 | purple_chat_conversation_buddy_get_name(const PurpleChatConversationBuddy *cb) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1730 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1731 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1732 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1733 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1734 | g_return_val_if_fail(priv != NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1735 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1736 | return priv->name; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1737 | } |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1738 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1739 | void |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1740 | purple_chat_conversation_buddy_set_flags(PurpleChatConversationBuddy *cb, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1741 | PurpleChatConversationBuddyFlags flags) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1742 | { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1743 | PurpleConversationUiOps *ops; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1744 | PurpleChatConversationBuddyFlags oldflags; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1745 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1746 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1747 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1748 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1749 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1750 | if (flags == priv->flags) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1751 | return; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1752 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1753 | oldflags = priv->flags; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1754 | priv->flags = flags; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1755 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1756 | ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(priv->chat)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1757 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1758 | if (ops != NULL && ops->chat_update_user != NULL) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1759 | ops->chat_update_user(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1760 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1761 | purple_signal_emit(purple_conversations_get_handle(), |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1762 | "chat-buddy-flags", priv->chat, priv->name, oldflags, flags); /* TODO use ChatBuddy object */ |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1763 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1764 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1765 | PurpleChatConversationBuddyFlags |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1766 | purple_chat_conversation_buddy_get_flags(const PurpleChatConversationBuddy *cb) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1767 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1768 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1769 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1770 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1771 | g_return_val_if_fail(priv != NULL, PURPLE_CHAT_CONVERSATION_BUDDY_NONE); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1772 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1773 | return priv->flags; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1774 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1775 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1776 | const char * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1777 | purple_chat_conversation_buddy_get_attribute(PurpleChatConversationBuddy *cb, const char *key) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1778 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1779 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1780 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1781 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1782 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1783 | g_return_val_if_fail(key != NULL, NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1784 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1785 | return g_hash_table_lookup(priv->attributes, key); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1786 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1787 | |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1788 | static void |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1789 | append_attribute_key(gpointer key, gpointer value, gpointer user_data) |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1790 | { |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1791 | GList **list = user_data; |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1792 | *list = g_list_prepend(*list, key); |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1793 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1794 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1795 | GList * |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1796 | purple_chat_conversation_buddy_get_attribute_keys(PurpleChatConversationBuddy *cb) |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1797 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1798 | GList *keys = NULL; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1799 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1800 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1801 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1802 | g_return_val_if_fail(priv != NULL, NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1803 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1804 | g_hash_table_foreach(priv->attributes, (GHFunc)append_attribute_key, &keys); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1805 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1806 | return keys; |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1807 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1808 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1809 | void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1810 | purple_chat_conversation_buddy_set_attribute(PurpleChatConversationBuddy *cb, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1811 | PurpleChatConversation *chat, const char *key, const char *value) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1812 | { |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1813 | PurpleConversationUiOps *ops; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1814 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1815 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1816 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1817 | g_return_if_fail(priv != NULL); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1818 | g_return_if_fail(key != NULL); |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1819 | g_return_if_fail(value != NULL); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1820 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1821 | g_hash_table_replace(priv->attributes, g_strdup(key), g_strdup(value)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1822 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1823 | ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1824 | |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1825 | if (ops != NULL && ops->chat_update_user != NULL) |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1826 | ops->chat_update_user(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1827 | } |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1828 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1829 | void |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1830 | purple_chat_conversation_buddy_set_attributes(PurpleChatConversationBuddy *cb, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1831 | PurpleChatConversation *chat, GList *keys, GList *values) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1832 | { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1833 | PurpleConversationUiOps *ops; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1834 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1835 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1836 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1837 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1838 | g_return_if_fail(keys != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1839 | g_return_if_fail(values != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1840 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1841 | while (keys != NULL && values != NULL) { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1842 | g_hash_table_replace(priv->attributes, g_strdup(keys->data), g_strdup(values->data)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1843 | keys = g_list_next(keys); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1844 | values = g_list_next(values); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1845 | } |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1846 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1847 | ops = purple_conversation_get_ui_ops(PURPLE_CONVERSATION(chat)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1848 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1849 | if (ops != NULL && ops->chat_update_user != NULL) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1850 | ops->chat_update_user(cb); |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1851 | } |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1852 | |
|
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1853 | void |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1854 | purple_chat_conversation_buddy_set_ui_data(PurpleChatConversationBuddy *cb, gpointer ui_data) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1855 | { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1856 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1857 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1858 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1859 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1860 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1861 | priv->ui_data = ui_data; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1862 | } |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1863 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1864 | gpointer |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1865 | purple_chat_conversation_buddy_get_ui_data(const PurpleChatConversationBuddy *cb) |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1866 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1867 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1868 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1869 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1870 | g_return_val_if_fail(priv != NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1871 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1872 | return priv->ui_data; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1873 | } |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1874 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1875 | void |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1876 | purple_chat_conversation_buddy_set_chat(PurpleChatConversationBuddy *cb, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1877 | PurpleChatConversation *chat) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1878 | { |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1879 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1880 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1881 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1882 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1883 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1884 | priv->chat = chat; |
|
34602
dbe6ee43aaa7
Created conversationtypes.[ch] for PurpleChatConversation and PurpleIMConversation
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1885 | } |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1886 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1887 | PurpleChatConversation * |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1888 | purple_chat_conversation_buddy_get_chat(const PurpleChatConversationBuddy *cb) |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1889 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1890 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1891 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1892 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1893 | g_return_val_if_fail(priv != NULL, NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1894 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1895 | return priv->chat; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1896 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1897 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1898 | void |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1899 | purple_chat_conversation_buddy_set_buddy(const PurpleChatConversationBuddy *cb, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1900 | gboolean buddy) |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1901 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1902 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1903 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1904 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1905 | g_return_if_fail(priv != NULL); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1906 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1907 | priv->buddy = buddy; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1908 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1909 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1910 | gboolean |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1911 | purple_chat_conversation_buddy_is_buddy(const PurpleChatConversationBuddy *cb) |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1912 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1913 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1914 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1915 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1916 | g_return_val_if_fail(priv != NULL, FALSE); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1917 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1918 | return priv->buddy; |
|
34649
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1919 | } |
|
4a0ec0fff2e1
Refactored PurpleConversation base object to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34648
diff
changeset
|
1920 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1921 | /************************************************************************** |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1922 | * GObject code for chat buddy |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1923 | **************************************************************************/ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1924 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1925 | /* GObject Property names */ |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1926 | #define CB_PROP_CHAT_S "chat" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1927 | #define CB_PROP_NAME_S "name" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1928 | #define CB_PROP_ALIAS_S "alias" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1929 | #define CB_PROP_BUDDY_S "buddy" |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1930 | #define CB_PROP_FLAGS_S "flags" |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1931 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1932 | /* Set method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1933 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1934 | purple_chat_conversation_buddy_set_property(GObject *obj, guint param_id, const GValue *value, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1935 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1936 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1937 | PurpleChatConversationBuddy *cb = PURPLE_CHAT_CONVERSATION_BUDDY(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1938 | PurpleChatConversationBuddyPrivate *priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(cb); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1939 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1940 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1941 | case CB_PROP_CHAT: |
|
34665
854204c05f70
Assign PurpleChatConversationBuddy initialization properties directly
Ankit Vani <a@nevitus.org>
parents:
34664
diff
changeset
|
1942 | priv->chat = g_value_get_object(value); |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1943 | break; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1944 | case CB_PROP_NAME: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1945 | g_free(priv->name); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1946 | priv->name = g_strdup(g_value_get_string(value)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1947 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1948 | case CB_PROP_ALIAS: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1949 | g_free(priv->alias); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1950 | priv->alias = g_strdup(g_value_get_string(value)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1951 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1952 | case CB_PROP_BUDDY: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1953 | priv->buddy = g_value_get_boolean(value); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1954 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1955 | case CB_PROP_FLAGS: |
|
34665
854204c05f70
Assign PurpleChatConversationBuddy initialization properties directly
Ankit Vani <a@nevitus.org>
parents:
34664
diff
changeset
|
1956 | priv->flags = g_value_get_flags(value); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1957 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1958 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1959 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1960 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1961 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1962 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1963 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1964 | /* Get method for GObject properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1965 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1966 | purple_chat_conversation_buddy_get_property(GObject *obj, guint param_id, GValue *value, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1967 | GParamSpec *pspec) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1968 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1969 | PurpleChatConversationBuddy *cb = PURPLE_CHAT_CONVERSATION_BUDDY(obj); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1970 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1971 | switch (param_id) { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1972 | case CB_PROP_CHAT: |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1973 | g_value_set_object(value, purple_chat_conversation_buddy_get_chat(cb)); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1974 | break; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1975 | case CB_PROP_NAME: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1976 | g_value_set_string(value, purple_chat_conversation_buddy_get_name(cb)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1977 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1978 | case CB_PROP_ALIAS: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1979 | g_value_set_string(value, purple_chat_conversation_buddy_get_alias(cb)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1980 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1981 | case CB_PROP_BUDDY: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1982 | g_value_set_boolean(value, purple_chat_conversation_buddy_is_buddy(cb)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1983 | break; |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1984 | case CB_PROP_FLAGS: |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1985 | g_value_set_flags(value, purple_chat_conversation_buddy_get_flags(cb)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1986 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1987 | default: |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1988 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1989 | break; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1990 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1991 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1992 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1993 | /* GObject initialization function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1994 | static void purple_chat_conversation_buddy_init(GTypeInstance *instance, gpointer klass) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
1995 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1996 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1997 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(instance); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1998 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
1999 | priv->attributes = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2000 | g_free, g_free); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2001 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2002 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2003 | /* GObject dispose function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2004 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2005 | purple_chat_conversation_buddy_dispose(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2006 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2007 | PurpleChatConversationBuddy *cb = PURPLE_CHAT_CONVERSATION_BUDDY(object); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2008 | |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2009 | purple_signal_emit(purple_conversations_get_handle(), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2010 | "deleting-chat-buddy", cb); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2011 | PURPLE_DBUS_UNREGISTER_POINTER(cb); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2012 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
2013 | cb_parent_class->dispose(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2014 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2015 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2016 | /* GObject finalize function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2017 | static void |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2018 | purple_chat_conversation_buddy_finalize(GObject *object) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2019 | { |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2020 | PurpleChatConversationBuddyPrivate *priv; |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2021 | priv = PURPLE_CHAT_CONVERSATION_BUDDY_GET_PRIVATE(object); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2022 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2023 | g_free(priv->alias); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2024 | g_free(priv->alias_key); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2025 | g_free(priv->name); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2026 | g_hash_table_destroy(priv->attributes); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2027 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
2028 | cb_parent_class->finalize(object); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2029 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2030 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2031 | /* Class initializer function */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2032 | static void purple_chat_conversation_buddy_class_init(PurpleChatConversationBuddyClass *klass) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2033 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2034 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2035 | |
|
34648
a6587d8cf907
Added missing API implementations to PurpleConversation and subclasses
Ankit Vani <a@nevitus.org>
parents:
34646
diff
changeset
|
2036 | cb_parent_class = g_type_class_peek_parent(klass); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2037 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2038 | obj_class->dispose = purple_chat_conversation_buddy_dispose; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2039 | obj_class->finalize = purple_chat_conversation_buddy_finalize; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2040 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2041 | /* Setup properties */ |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2042 | obj_class->get_property = purple_chat_conversation_buddy_get_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2043 | obj_class->set_property = purple_chat_conversation_buddy_set_property; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2044 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2045 | g_object_class_install_property(obj_class, CB_PROP_CHAT, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2046 | g_param_spec_object(CB_PROP_CHAT_S, _("Chat"), |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2047 | _("The chat the buddy belongs to."), PURPLE_TYPE_CHAT_CONVERSATION, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2048 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT) |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2049 | ); |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2050 | |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2051 | g_object_class_install_property(obj_class, CB_PROP_NAME, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2052 | g_param_spec_string(CB_PROP_NAME_S, _("Name"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2053 | _("Name of the chat buddy."), NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2054 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2055 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2056 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2057 | g_object_class_install_property(obj_class, CB_PROP_ALIAS, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2058 | g_param_spec_string(CB_PROP_ALIAS_S, _("Alias"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2059 | _("Alias of the chat buddy."), NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2060 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2061 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2062 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2063 | g_object_class_install_property(obj_class, CB_PROP_BUDDY, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2064 | g_param_spec_boolean(CB_PROP_BUDDY_S, _("Is buddy"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2065 | _("Whether the chat buddy is in the buddy list."), FALSE, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2066 | G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2067 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2068 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2069 | g_object_class_install_property(obj_class, CB_PROP_FLAGS, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2070 | g_param_spec_flags(CB_PROP_FLAGS_S, _("Buddy flags"), |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2071 | _("The flags for the chat buddy."), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2072 | PURPLE_TYPE_CHAT_CONVERSATION_BUDDY_FLAGS, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2073 | PURPLE_CHAT_CONVERSATION_BUDDY_NONE, G_PARAM_READWRITE) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2074 | ); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2075 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2076 | g_type_class_add_private(klass, sizeof(PurpleChatConversationBuddyPrivate)); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2077 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2078 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2079 | GType |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2080 | purple_chat_conversation_buddy_get_type(void) |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2081 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2082 | static GType type = 0; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2083 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2084 | if(type == 0) { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2085 | static const GTypeInfo info = { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2086 | sizeof(PurpleChatConversationBuddyClass), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2087 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2088 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2089 | (GClassInitFunc)purple_chat_conversation_buddy_class_init, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2090 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2091 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2092 | sizeof(PurpleChatConversationBuddy), |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2093 | 0, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2094 | (GInstanceInitFunc)purple_chat_conversation_buddy_init, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2095 | NULL, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2096 | }; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2097 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2098 | type = g_type_register_static(G_TYPE_OBJECT, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2099 | "PurpleChatConversationBuddy", |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2100 | &info, 0); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2101 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2102 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2103 | return type; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2104 | } |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2105 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2106 | PurpleChatConversationBuddy * |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2107 | purple_chat_conversation_buddy_new(PurpleChatConversation *chat, const char *name, |
|
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2108 | const char *alias, PurpleChatConversationBuddyFlags flags) |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2109 | { |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2110 | PurpleChatConversationBuddy *cb; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2111 | |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2112 | g_return_val_if_fail(chat != NULL, NULL); |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2113 | g_return_val_if_fail(name != NULL, NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2114 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2115 | cb = g_object_new(PURPLE_TYPE_CHAT_CONVERSATION_BUDDY, |
|
34651
88c104a20f4b
Refactored the PurpleConversation subclasses and subsystem to use the GObject conversation API.
Ankit Vani <a@nevitus.org>
parents:
34649
diff
changeset
|
2116 | "chat", chat, |
|
34646
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2117 | "name", name, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2118 | "alias", alias, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2119 | "flags", flags, |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2120 | NULL); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2121 | |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2122 | PURPLE_DBUS_REGISTER_POINTER(cb, PurpleChatConversationBuddy); |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2123 | return cb; |
|
e7f4631e93f7
Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents:
34620
diff
changeset
|
2124 | } |