Sun, 16 Oct 2011 03:03:39 +0000
Remove free_memory argument from D-Bus list functions. It's already
always set to FALSE in the auto-generated code.
Fixes #1747.
| 66 | 1 | /* |
| 15884 | 2 | * purple |
| 66 | 3 | * |
| 15884 | 4 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
7 | * |
| 66 | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19769
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 66 | 21 | */ |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
22 | #include "internal.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
23 | #include "blist.h" |
|
17266
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
24 | #include "cmds.h" |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
25 | #include "conversation.h" |
|
11146
c56333373e3c
[gaim-migrate @ 13217]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents:
11137
diff
changeset
|
26 | #include "dbus-maybe.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
27 | #include "debug.h" |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6846
diff
changeset
|
28 | #include "imgstore.h" |
|
5436
a0e0bacaa196
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5350
diff
changeset
|
29 | #include "notify.h" |
|
5539
a13dd0ba205a
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
30 | #include "prefs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
31 | #include "prpl.h" |
| 14582 | 32 | #include "request.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
33 | #include "signals.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
34 | #include "util.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5860
diff
changeset
|
35 | |
|
25716
1b5be208d5ba
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
24051
diff
changeset
|
36 | #define SEND_TYPED_TIMEOUT_SECONDS 5 |
| 4241 | 37 | |
|
32613
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
38 | /** |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
39 | * Data specific to Chats. |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
40 | */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
41 | struct _PurpleConvChat |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
42 | { |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
43 | PurpleConversation *conv; /**< The parent conversation. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
44 | |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
45 | GList *in_room; /**< The users in the room. |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
46 | * @deprecated Will be removed in 3.0.0 |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
47 | */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
48 | GList *ignored; /**< Ignored users. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
49 | char *who; /**< The person who set the topic. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
50 | char *topic; /**< The topic. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
51 | int id; /**< The chat ID. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
52 | char *nick; /**< Your nick in this chat. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
53 | |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
54 | gboolean left; /**< We left the chat and kept the window open */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
55 | GHashTable *users; /**< Hash table of the users in the room. */ |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
56 | }; |
|
cc59a239bdb9
Hide struct _PurpleConvChat.
Andrew Victor <andrew.victor@mxit.com>
parents:
32336
diff
changeset
|
57 | |
|
32614
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
58 | /** |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
59 | * Data specific to Instant Messages. |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
60 | */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
61 | struct _PurpleConvIm |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
62 | { |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
63 | PurpleConversation *conv; /**< The parent conversation. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
64 | |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
65 | PurpleTypingState typing_state; /**< The current typing state. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
66 | guint typing_timeout; /**< The typing timer handle. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
67 | time_t type_again; /**< The type again time. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
68 | guint send_typed_timeout; /**< The type again timer handle. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
69 | |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
70 | PurpleBuddyIcon *icon; /**< The buddy icon. */ |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
71 | }; |
|
bd51e25ab7b6
Hide struct _PurpleConvIm.
Andrew Victor <andrew.victor@mxit.com>
parents:
32613
diff
changeset
|
72 | |
|
32615
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
73 | /** |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
74 | * Data for "Chat Buddies" |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
75 | */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
76 | struct _PurpleConvChatBuddy |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
77 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
78 | /** The chat participant's name in the chat. */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
79 | char *name; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
80 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
81 | /** The chat participant's alias, if known; @a NULL otherwise. */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
82 | char *alias; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
83 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
84 | /** |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
85 | * A string by which this buddy will be sorted, or @c NULL if the |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
86 | * buddy should be sorted by its @c name. (This is currently always |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
87 | * @c NULL. |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
88 | */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
89 | char *alias_key; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
90 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
91 | /** |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
92 | * @a TRUE if this chat participant is on the buddy list; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
93 | * @a FALSE otherwise. |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
94 | */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
95 | gboolean buddy; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
96 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
97 | /** |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
98 | * A bitwise OR of flags for this participant, such as whether they |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
99 | * are a channel operator. |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
100 | */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
101 | PurpleConvChatBuddyFlags flags; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
102 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
103 | /** |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
104 | * A hash table of attributes about the user, such as real name, |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
105 | * user\@host, etc. |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
106 | */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
107 | GHashTable *attributes; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
108 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
109 | /** The UI can put whatever it wants here. */ |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
110 | gpointer ui_data; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
111 | }; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
112 | |
|
32621
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
113 | /** |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
114 | * A core representation of a conversation between two or more people. |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
115 | * |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
116 | * The conversation can be an IM or a chat. |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
117 | */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
118 | struct _PurpleConversation |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
119 | { |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
120 | PurpleConversationType type; /**< The type of conversation. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
121 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
122 | PurpleAccount *account; /**< The user using this conversation. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
123 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
124 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
125 | char *name; /**< The name of the conversation. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
126 | char *title; /**< The window title. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
127 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
128 | gboolean logging; /**< The status of logging. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
129 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
130 | GList *logs; /**< This conversation's logs */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
131 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
132 | union |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
133 | { |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
134 | PurpleConvIm *im; /**< IM-specific data. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
135 | PurpleConvChat *chat; /**< Chat-specific data. */ |
|
32633
f9073e555cbd
Restore a union member lost in the merge due to struct hiding.
Kevin Stange <kstange@pidgin.im>
parents:
32624
diff
changeset
|
136 | void *misc; /**< Misc. data. */ |
|
f9073e555cbd
Restore a union member lost in the merge due to struct hiding.
Kevin Stange <kstange@pidgin.im>
parents:
32624
diff
changeset
|
137 | |
|
32621
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
138 | } u; |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
139 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
140 | PurpleConversationUiOps *ui_ops; /**< UI-specific operations. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
141 | void *ui_data; /**< UI-specific data. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
142 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
143 | GHashTable *data; /**< Plugin-specific data. */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
144 | |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
145 | PurpleConnectionFlags features; /**< The supported features */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
146 | GList *message_history; /**< Message history, as a GList of PurpleConvMessage's */ |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
147 | }; |
|
aa5f7a20e0fa
Hide struct _PurpleConversation.
Andrew Victor <andrew.victor@mxit.com>
parents:
32615
diff
changeset
|
148 | |
|
32615
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
149 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
150 | static GList *conversations = NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
151 | static GList *ims = NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
152 | static GList *chats = NULL; |
| 15884 | 153 | static PurpleConversationUiOps *default_ops = NULL; |
| 11581 | 154 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
155 | /** |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
156 | * A hash table used for efficient lookups of conversations by name. |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
157 | * struct _purple_hconv => PurpleConversation* |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
158 | */ |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
159 | static GHashTable *conversation_cache = NULL; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
160 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
161 | struct _purple_hconv { |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
162 | PurpleConversationType type; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
163 | char *name; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
164 | const PurpleAccount *account; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
165 | }; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
166 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
167 | static guint _purple_conversations_hconv_hash(struct _purple_hconv *hc) |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
168 | { |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
169 | return g_str_hash(hc->name) ^ hc->type ^ g_direct_hash(hc->account); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
170 | } |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
171 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
172 | static guint _purple_conversations_hconv_equal(struct _purple_hconv *hc1, struct _purple_hconv *hc2) |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
173 | { |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
174 | return (hc1->type == hc2->type && |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
175 | hc1->account == hc2->account && |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
176 | g_str_equal(hc1->name, hc2->name)); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
177 | } |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
178 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
179 | static void _purple_conversations_hconv_free_key(struct _purple_hconv *hc) |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
180 | { |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
181 | g_free(hc->name); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
182 | g_free(hc); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
183 | } |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
184 | |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
185 | static guint _purple_conversation_user_hash(gconstpointer data) |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
186 | { |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
187 | const gchar *name = data; |
|
31909
6367f2188824
conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
31908
diff
changeset
|
188 | gchar *collated; |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
189 | guint hash; |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
190 | |
|
31909
6367f2188824
conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
31908
diff
changeset
|
191 | collated = g_utf8_collate_key(name, -1); |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
192 | hash = g_str_hash(collated); |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
193 | g_free(collated); |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
194 | return hash; |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
195 | } |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
196 | |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
197 | static gboolean _purple_conversation_user_equal(gconstpointer a, gconstpointer b) |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
198 | { |
|
31909
6367f2188824
conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
31908
diff
changeset
|
199 | return !g_utf8_collate(a, b); |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
200 | } |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
201 | |
| 11581 | 202 | void |
| 15884 | 203 | purple_conversations_set_ui_ops(PurpleConversationUiOps *ops) |
| 11581 | 204 | { |
| 205 | default_ops = ops; | |
| 206 | } | |
|
7602
1b9f55e57af3
[gaim-migrate @ 8225]
Christian Hammond <chipx86@chipx86.com>
parents:
7562
diff
changeset
|
207 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
208 | static gboolean |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
209 | reset_typing_cb(gpointer data) |
| 66 | 210 | { |
| 15884 | 211 | PurpleConversation *c = (PurpleConversation *)data; |
| 212 | PurpleConvIm *im; | |
| 213 | ||
| 214 | im = PURPLE_CONV_IM(c); | |
| 215 | ||
| 216 | purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING); | |
| 217 | purple_conv_im_stop_typing_timeout(im); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
218 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
219 | return FALSE; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
220 | } |
| 3159 | 221 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
222 | static gboolean |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
223 | send_typed_cb(gpointer data) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
224 | { |
| 15884 | 225 | PurpleConversation *conv = (PurpleConversation *)data; |
| 226 | PurpleConnection *gc; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
227 | const char *name; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
228 | |
|
13714
babc08c1c499
[gaim-migrate @ 16116]
Richard Laager <rlaager@pidgin.im>
parents:
13664
diff
changeset
|
229 | g_return_val_if_fail(conv != NULL, FALSE); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
230 | |
| 15884 | 231 | gc = purple_conversation_get_gc(conv); |
| 232 | name = purple_conversation_get_name(conv); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
233 | |
|
13714
babc08c1c499
[gaim-migrate @ 16116]
Richard Laager <rlaager@pidgin.im>
parents:
13664
diff
changeset
|
234 | if (gc != NULL && name != NULL) { |
| 15884 | 235 | /* We set this to 1 so that PURPLE_TYPING will be sent |
| 236 | * if the Purple user types anything else. | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
237 | */ |
| 15884 | 238 | purple_conv_im_set_type_again(PURPLE_CONV_IM(conv), 1); |
| 239 | ||
| 240 | serv_send_typing(gc, name, PURPLE_TYPED); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
241 | |
| 15884 | 242 | purple_debug(PURPLE_DEBUG_MISC, "conversation", "typed...\n"); |
|
573
a267d68a8240
[gaim-migrate @ 583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
570
diff
changeset
|
243 | } |
| 66 | 244 | |
|
2725
a844d0964552
[gaim-migrate @ 2738]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2722
diff
changeset
|
245 | return FALSE; |
| 66 | 246 | } |
| 247 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
248 | static void |
| 15884 | 249 | common_send(PurpleConversation *conv, const char *message, PurpleMessageFlags msgflags) |
| 3790 | 250 | { |
| 15884 | 251 | PurpleConversationType type; |
| 252 | PurpleAccount *account; | |
| 253 | PurpleConnection *gc; | |
|
8076
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
254 | char *displayed = NULL, *sent = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
255 | int err = 0; |
| 3790 | 256 | |
|
23440
d20160530c78
Don't use strlen() when we can just check the first character
Mark Doliner <markdoliner@pidgin.im>
parents:
23312
diff
changeset
|
257 | if (*message == '\0') |
|
7947
76de4859a53a
[gaim-migrate @ 8621]
Mark Doliner <markdoliner@pidgin.im>
parents:
7930
diff
changeset
|
258 | return; |
|
76de4859a53a
[gaim-migrate @ 8621]
Mark Doliner <markdoliner@pidgin.im>
parents:
7930
diff
changeset
|
259 | |
| 15884 | 260 | account = purple_conversation_get_account(conv); |
| 261 | gc = purple_conversation_get_gc(conv); | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
262 | |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
263 | g_return_if_fail(account != NULL); |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
264 | g_return_if_fail(gc != NULL); |
| 3731 | 265 | |
| 15884 | 266 | type = purple_conversation_get_type(conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
267 | |
|
18087
b56ec2e9dae6
add a PURPLE_MESSAGE_NO_LINKIFY to prevent things from getting linkified
Nathan Walp <nwalp@pidgin.im>
parents:
18068
diff
changeset
|
268 | /* Always linkfy the text for display, unless we're |
|
b56ec2e9dae6
add a PURPLE_MESSAGE_NO_LINKIFY to prevent things from getting linkified
Nathan Walp <nwalp@pidgin.im>
parents:
18068
diff
changeset
|
269 | * explicitly asked to do otheriwse*/ |
|
19674
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
270 | if (!(msgflags & PURPLE_MESSAGE_INVISIBLE)) { |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
271 | if(msgflags & PURPLE_MESSAGE_NO_LINKIFY) |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
272 | displayed = g_strdup(message); |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
273 | else |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
274 | displayed = purple_markup_linkify(message); |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
275 | } |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
276 | |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
277 | if (displayed && (conv->features & PURPLE_CONNECTION_HTML) && |
|
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
278 | !(msgflags & PURPLE_MESSAGE_RAW)) { |
|
12901
85ddd02a44d1
[gaim-migrate @ 15254]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12867
diff
changeset
|
279 | sent = g_strdup(displayed); |
|
19674
371069ae12fd
Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19672
diff
changeset
|
280 | } else |
|
12901
85ddd02a44d1
[gaim-migrate @ 15254]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12867
diff
changeset
|
281 | sent = g_strdup(message); |
| 5136 | 282 | |
| 15884 | 283 | msgflags |= PURPLE_MESSAGE_SEND; |
| 284 | ||
| 285 | if (type == PURPLE_CONV_TYPE_IM) { | |
| 286 | PurpleConvIm *im = PURPLE_CONV_IM(conv); | |
| 287 | ||
| 288 | purple_signal_emit(purple_conversations_get_handle(), "sending-im-msg", | |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
289 | account, |
| 15884 | 290 | purple_conversation_get_name(conv), &sent); |
|
8076
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
291 | |
|
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
292 | if (sent != NULL && sent[0] != '\0') { |
|
12216
d80739091a63
[gaim-migrate @ 14518]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12018
diff
changeset
|
293 | |
| 15884 | 294 | err = serv_send_im(gc, purple_conversation_get_name(conv), |
|
12216
d80739091a63
[gaim-migrate @ 14518]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12018
diff
changeset
|
295 | sent, msgflags); |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6846
diff
changeset
|
296 | |
|
8078
e8e087085339
[gaim-migrate @ 8777]
Mark Doliner <markdoliner@pidgin.im>
parents:
8076
diff
changeset
|
297 | if ((err > 0) && (displayed != NULL)) |
| 15884 | 298 | purple_conv_im_write(im, NULL, displayed, msgflags, time(NULL)); |
| 299 | ||
| 300 | purple_signal_emit(purple_conversations_get_handle(), "sent-im-msg", | |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
301 | account, |
| 15884 | 302 | purple_conversation_get_name(conv), sent); |
|
2102
2d024ad2e07b
[gaim-migrate @ 2112]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2094
diff
changeset
|
303 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
304 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
305 | else { |
| 15884 | 306 | purple_signal_emit(purple_conversations_get_handle(), "sending-chat-msg", |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
307 | account, &sent, |
| 15884 | 308 | purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
309 | |
|
8076
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
310 | if (sent != NULL && sent[0] != '\0') { |
| 15884 | 311 | err = serv_chat_send(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)), sent, msgflags); |
| 312 | ||
| 313 | purple_signal_emit(purple_conversations_get_handle(), "sent-chat-msg", | |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
314 | account, sent, |
| 15884 | 315 | purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
316 | } |
|
472
9a5b8da2d760
[gaim-migrate @ 482]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
411
diff
changeset
|
317 | } |
|
1253
f02697a6aada
[gaim-migrate @ 1263]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
318 | |
|
2123
4cfdde0aa3f1
[gaim-migrate @ 2133]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2111
diff
changeset
|
319 | if (err < 0) { |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
320 | const char *who; |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12902
diff
changeset
|
321 | const char *msg; |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
322 | |
| 15884 | 323 | who = purple_conversation_get_name(conv); |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
324 | |
|
5213
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
325 | if (err == -E2BIG) { |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
326 | msg = _("Unable to send message: The message is too large."); |
|
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
327 | |
| 15884 | 328 | if (!purple_conv_present_error(who, account, msg)) { |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12902
diff
changeset
|
329 | char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); |
| 15884 | 330 | purple_notify_error(gc, NULL, msg2, _("The message is too large.")); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12902
diff
changeset
|
331 | g_free(msg2); |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
332 | } |
|
5213
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
333 | } |
|
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
334 | else if (err == -ENOTCONN) { |
| 15884 | 335 | purple_debug(PURPLE_DEBUG_ERROR, "conversation", |
|
5213
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
336 | "Not yet connected.\n"); |
|
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
337 | } |
|
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
338 | else { |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
339 | msg = _("Unable to send message."); |
|
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
340 | |
| 15884 | 341 | if (!purple_conv_present_error(who, account, msg)) { |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12902
diff
changeset
|
342 | char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who); |
| 15884 | 343 | purple_notify_error(gc, NULL, msg2, NULL); |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12902
diff
changeset
|
344 | g_free(msg2); |
|
10132
a11b4c81d70d
[gaim-migrate @ 11196]
Evan Schoenberg <evands@pidgin.im>
parents:
10116
diff
changeset
|
345 | } |
|
5213
d56ea526b80c
[gaim-migrate @ 5583]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
346 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
347 | } |
|
8076
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
348 | |
|
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
349 | g_free(displayed); |
|
1c3c1ad737e8
[gaim-migrate @ 8775]
Mark Doliner <markdoliner@pidgin.im>
parents:
8046
diff
changeset
|
350 | g_free(sent); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
351 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
352 | |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
353 | static void |
| 15884 | 354 | open_log(PurpleConversation *conv) |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
355 | { |
| 15884 | 356 | conv->logs = g_list_append(NULL, purple_log_new(conv->type == PURPLE_CONV_TYPE_CHAT ? PURPLE_LOG_CHAT : |
| 357 | PURPLE_LOG_IM, conv->name, conv->account, | |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13107
diff
changeset
|
358 | conv, time(NULL), NULL)); |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
359 | } |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
360 | |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
361 | /* Functions that deal with PurpleConvMessage */ |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
362 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
363 | static void |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
364 | add_message_to_history(PurpleConversation *conv, const char *who, const char *alias, |
|
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
365 | const char *message, PurpleMessageFlags flags, time_t when) |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
366 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
367 | PurpleConvMessage *msg; |
|
22458
42e804b6db56
Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
368 | PurpleConnection *gc; |
|
42e804b6db56
Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
369 | |
|
42e804b6db56
Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
370 | gc = purple_account_get_connection(conv->account); |
|
19601
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
371 | |
|
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
372 | if (flags & PURPLE_MESSAGE_SEND) { |
|
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
373 | const char *me = NULL; |
|
22458
42e804b6db56
Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
374 | if (gc) |
|
42e804b6db56
Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
375 | me = purple_connection_get_display_name(gc); |
|
19601
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
376 | if (!me) |
|
32623
547eacef0b63
Convert libpurple and protocol prpl's to use the purple_account_* accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32621
diff
changeset
|
377 | me = purple_account_get_username(conv->account); |
|
19601
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
378 | who = me; |
|
8f000de5f9de
Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19595
diff
changeset
|
379 | } |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
380 | |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
381 | msg = g_new0(PurpleConvMessage, 1); |
|
19595
acd61f0d6a81
DBus-ify the message history in a conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19593
diff
changeset
|
382 | PURPLE_DBUS_REGISTER_POINTER(msg, PurpleConvMessage); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
383 | msg->who = g_strdup(who); |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
384 | msg->alias = g_strdup(alias); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
385 | msg->flags = flags; |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
386 | msg->what = g_strdup(message); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
387 | msg->when = when; |
|
20422
49be7bdacd56
Contactize the message history when re-attaching the pidgin ui.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20420
diff
changeset
|
388 | msg->conv = conv; |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
389 | |
|
19904
8abf4c2056eb
Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
390 | conv->message_history = g_list_prepend(conv->message_history, msg); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
391 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
392 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
393 | static void |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
394 | free_conv_message(PurpleConvMessage *msg) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
395 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
396 | g_free(msg->who); |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
397 | g_free(msg->alias); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
398 | g_free(msg->what); |
|
19595
acd61f0d6a81
DBus-ify the message history in a conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19593
diff
changeset
|
399 | PURPLE_DBUS_UNREGISTER_POINTER(msg); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
400 | g_free(msg); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
401 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
402 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
403 | static void |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
404 | message_history_free(GList *list) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
405 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
406 | g_list_foreach(list, (GFunc)free_conv_message, NULL); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
407 | g_list_free(list); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
408 | } |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
409 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
410 | /************************************************************************** |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
411 | * Conversation API |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
412 | **************************************************************************/ |
| 8256 | 413 | static void |
| 15884 | 414 | purple_conversation_chat_cleanup_for_rejoin(PurpleConversation *conv) |
| 8256 | 415 | { |
| 416 | const char *disp; | |
| 15884 | 417 | PurpleAccount *account; |
| 418 | PurpleConnection *gc; | |
| 419 | ||
| 420 | account = purple_conversation_get_account(conv); | |
| 421 | ||
| 422 | purple_conversation_close_logs(conv); | |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
423 | open_log(conv); |
| 8373 | 424 | |
| 15884 | 425 | gc = purple_account_get_connection(account); |
| 426 | ||
| 427 | if ((disp = purple_connection_get_display_name(gc)) != NULL) | |
| 428 | purple_conv_chat_set_nick(PURPLE_CONV_CHAT(conv), disp); | |
| 8373 | 429 | else |
| 430 | { | |
| 15884 | 431 | purple_conv_chat_set_nick(PURPLE_CONV_CHAT(conv), |
| 432 | purple_account_get_username(account)); | |
| 8256 | 433 | } |
| 434 | ||
| 15884 | 435 | purple_conv_chat_clear_users(PURPLE_CONV_CHAT(conv)); |
| 436 | purple_conv_chat_set_topic(PURPLE_CONV_CHAT(conv), NULL, NULL); | |
| 437 | PURPLE_CONV_CHAT(conv)->left = FALSE; | |
| 438 | ||
| 439 | purple_conversation_update(conv, PURPLE_CONV_UPDATE_CHATLEFT); | |
| 8256 | 440 | } |
| 441 | ||
| 15884 | 442 | PurpleConversation * |
| 443 | purple_conversation_new(PurpleConversationType type, PurpleAccount *account, | |
|
4476
bf88170ba269
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4471
diff
changeset
|
444 | const char *name) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
445 | { |
| 15884 | 446 | PurpleConversation *conv; |
| 447 | PurpleConnection *gc; | |
| 448 | PurpleConversationUiOps *ops; | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
449 | struct _purple_hconv *hc; |
| 15884 | 450 | |
| 451 | g_return_val_if_fail(type != PURPLE_CONV_TYPE_UNKNOWN, NULL); | |
|
7088
0920bc6160ae
[gaim-migrate @ 7653]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
452 | g_return_val_if_fail(account != NULL, NULL); |
|
0920bc6160ae
[gaim-migrate @ 7653]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
453 | g_return_val_if_fail(name != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
454 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
455 | /* Check if this conversation already exists. */ |
| 15884 | 456 | if ((conv = purple_find_conversation_with_account(type, name, account)) != NULL) |
|
8271
a79531291e7f
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
457 | { |
|
27954
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
458 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT && |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
459 | !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) { |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
460 | purple_debug_warning("conversation", "Trying to create multiple " |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
461 | "chats (%s) with the same name is deprecated and will be " |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
462 | "removed in libpurple 3.0.0", name); |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
463 | } |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
464 | |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
465 | /* |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
466 | * This hack is necessary because some prpls (MSN) have unnamed chats |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
467 | * that all use the same name. A PurpleConversation for one of those |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
468 | * is only ever re-used if the user has left, so calls to |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
469 | * purple_conversation_new need to fall-through to creating a new |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
470 | * chat. |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
471 | * TODO 3.0.0: Remove this workaround and mandate unique names. |
|
46719dcc12d1
Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
472 | */ |
|
22170
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
473 | if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT || |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
474 | purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) |
|
22170
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
475 | { |
|
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
476 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) |
|
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
477 | purple_conversation_chat_cleanup_for_rejoin(conv); |
|
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
478 | |
|
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
479 | return conv; |
|
07ee0f226796
I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
480 | } |
| 8256 | 481 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
482 | |
| 15884 | 483 | gc = purple_account_get_connection(account); |
| 10665 | 484 | g_return_val_if_fail(gc != NULL, NULL); |
| 485 | ||
| 15884 | 486 | conv = g_new0(PurpleConversation, 1); |
| 487 | PURPLE_DBUS_REGISTER_POINTER(conv, PurpleConversation); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
488 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
489 | conv->type = type; |
| 4491 | 490 | conv->account = account; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
491 | conv->name = g_strdup(name); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
492 | conv->title = g_strdup(name); |
|
5139
24c56d94ed79
[gaim-migrate @ 5503]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
493 | conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
494 | g_free, NULL); |
| 10665 | 495 | /* copy features from the connection. */ |
| 496 | conv->features = gc->flags; | |
| 11581 | 497 | |
| 15884 | 498 | if (type == PURPLE_CONV_TYPE_IM) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
499 | { |
| 15884 | 500 | PurpleBuddyIcon *icon; |
| 501 | conv->u.im = g_new0(PurpleConvIm, 1); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
502 | conv->u.im->conv = conv; |
| 15884 | 503 | PURPLE_DBUS_REGISTER_POINTER(conv->u.im, PurpleConvIm); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
504 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
505 | ims = g_list_prepend(ims, conv); |
| 15884 | 506 | if ((icon = purple_buddy_icons_find(account, name))) |
|
16900
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16545
diff
changeset
|
507 | { |
| 15884 | 508 | purple_conv_im_set_icon(conv->u.im, icon); |
|
16900
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16545
diff
changeset
|
509 | /* purple_conv_im_set_icon refs the icon. */ |
|
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16545
diff
changeset
|
510 | purple_buddy_icon_unref(icon); |
|
e9f12eb06c5b
Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@pidgin.im>
parents:
16545
diff
changeset
|
511 | } |
| 15884 | 512 | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
513 | if (purple_prefs_get_bool("/purple/logging/log_ims")) |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
514 | { |
| 15884 | 515 | purple_conversation_set_logging(conv, TRUE); |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
516 | open_log(conv); |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
517 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
518 | } |
| 15884 | 519 | else if (type == PURPLE_CONV_TYPE_CHAT) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
520 | { |
| 8158 | 521 | const char *disp; |
| 522 | ||
| 15884 | 523 | conv->u.chat = g_new0(PurpleConvChat, 1); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
524 | conv->u.chat->conv = conv; |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
525 | conv->u.chat->users = g_hash_table_new_full(_purple_conversation_user_hash, |
|
31905
1a27482becf4
conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <darkrain42@pidgin.im>
parents:
31903
diff
changeset
|
526 | _purple_conversation_user_equal, g_free, NULL); |
| 15884 | 527 | PURPLE_DBUS_REGISTER_POINTER(conv->u.chat, PurpleConvChat); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
528 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
529 | chats = g_list_prepend(chats, conv); |
|
8271
a79531291e7f
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
530 | |
|
32624
f957ad287bcc
Convert code to use the purple_account accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32623
diff
changeset
|
531 | if ((disp = purple_connection_get_display_name(purple_account_get_connection(account)))) |
| 15884 | 532 | purple_conv_chat_set_nick(conv->u.chat, disp); |
|
8271
a79531291e7f
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
533 | else |
| 15884 | 534 | purple_conv_chat_set_nick(conv->u.chat, |
| 535 | purple_account_get_username(account)); | |
| 536 | ||
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
537 | if (purple_prefs_get_bool("/purple/logging/log_chats")) |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
538 | { |
| 15884 | 539 | purple_conversation_set_logging(conv, TRUE); |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
540 | open_log(conv); |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
541 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
542 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
543 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
544 | conversations = g_list_prepend(conversations, conv); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
545 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
546 | hc = g_new(struct _purple_hconv, 1); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
547 | hc->name = g_strdup(purple_normalize(account, conv->name)); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
548 | hc->account = account; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
549 | hc->type = type; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
550 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
551 | g_hash_table_insert(conversation_cache, hc, conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
552 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
553 | /* Auto-set the title. */ |
| 15884 | 554 | purple_conversation_autoset_title(conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
555 | |
|
11602
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
556 | /* Don't move this.. it needs to be one of the last things done otherwise |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
557 | * it causes mysterious crashes on my system. |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
558 | * -- Gary |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
559 | */ |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
560 | ops = conv->ui_ops = default_ops; |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
561 | if (ops != NULL && ops->create_conversation != NULL) |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
562 | ops->create_conversation(conv); |
|
bcbd0c5543ec
[gaim-migrate @ 13873]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11598
diff
changeset
|
563 | |
| 15884 | 564 | purple_signal_emit(purple_conversations_get_handle(), |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
565 | "conversation-created", conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
566 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
567 | return conv; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
568 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
569 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
570 | void |
| 15884 | 571 | purple_conversation_destroy(PurpleConversation *conv) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
572 | { |
| 15884 | 573 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 574 | PurpleConversationUiOps *ops; | |
| 575 | PurpleConnection *gc; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
576 | const char *name; |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
577 | struct _purple_hconv hc; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
578 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
579 | g_return_if_fail(conv != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
580 | |
| 15884 | 581 | purple_request_close_with_handle(conv); |
| 582 | ||
| 583 | ops = purple_conversation_get_ui_ops(conv); | |
| 584 | gc = purple_conversation_get_gc(conv); | |
| 585 | name = purple_conversation_get_name(conv); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
586 | |
| 8373 | 587 | if (gc != NULL) |
| 588 | { | |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
589 | /* Still connected */ |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22170
diff
changeset
|
590 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
| 15884 | 591 | |
| 592 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) | |
| 8373 | 593 | { |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
594 | if (purple_prefs_get_bool("/purple/conversations/im/send_typing")) |
| 15884 | 595 | serv_send_typing(gc, name, PURPLE_NOT_TYPING); |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
596 | |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
597 | if (gc && prpl_info->convo_closed != NULL) |
|
6403
9b2428783d7c
[gaim-migrate @ 6908]
Christian Hammond <chipx86@chipx86.com>
parents:
6402
diff
changeset
|
598 | prpl_info->convo_closed(gc, name); |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
599 | } |
| 15884 | 600 | else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) |
| 8373 | 601 | { |
| 15884 | 602 | int chat_id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); |
|
8271
a79531291e7f
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
603 | #if 0 |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
604 | /* |
|
6030
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
605 | * This is unfortunately necessary, because calling |
| 15884 | 606 | * serv_chat_leave() calls this purple_conversation_destroy(), |
|
6030
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
607 | * which leads to two calls here.. We can't just return after |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
608 | * this, because then it'll return on the next pass. So, since |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
609 | * serv_got_chat_left(), which is eventually called from the |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
610 | * prpl that serv_chat_leave() calls, removes this conversation |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
611 | * from the gc's buddy_chats list, we're going to check to see |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
612 | * if this exists in the list. If so, we want to return after |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
613 | * calling this, because it'll be called again. If not, fall |
|
0e20bf585317
[gaim-migrate @ 6480]
Christian Hammond <chipx86@chipx86.com>
parents:
6020
diff
changeset
|
614 | * through, because it'll have already been removed, and we'd |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
615 | * be on the 2nd pass. |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
616 | * |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
617 | * Long paragraph. <-- Short sentence. |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
618 | * |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
619 | * -- ChipX86 |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
620 | */ |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
621 | |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
622 | if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) { |
| 8373 | 623 | serv_chat_leave(gc, chat_id); |
|
5262
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
624 | |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
625 | return; |
|
2e879b7de7fd
[gaim-migrate @ 5634]
José Mª Pérez Cáncer <jm_pc@users.sourceforge.net>
parents:
5213
diff
changeset
|
626 | } |
|
8271
a79531291e7f
[gaim-migrate @ 8995]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
627 | #endif |
| 8373 | 628 | /* |
| 629 | * Instead of all of that, lets just close the window when | |
| 630 | * the user tells us to, and let the prpl deal with the | |
| 631 | * internals on it's own time. Don't do this if the prpl already | |
| 632 | * knows it left the chat. | |
| 633 | */ | |
| 15884 | 634 | if (!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) |
| 8373 | 635 | serv_chat_leave(gc, chat_id); |
| 636 | ||
| 637 | /* | |
| 638 | * If they didn't call serv_got_chat_left by now, it's too late. | |
| 639 | * So we better do it for them before we destroy the thing. | |
| 640 | */ | |
| 15884 | 641 | if (!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) |
| 8373 | 642 | serv_got_chat_left(gc, chat_id); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
643 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
644 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
645 | |
|
12018
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
646 | /* remove from conversations and im/chats lists prior to emit */ |
|
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
647 | conversations = g_list_remove(conversations, conv); |
|
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
648 | |
| 15884 | 649 | if(conv->type==PURPLE_CONV_TYPE_IM) |
|
12018
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
650 | ims = g_list_remove(ims, conv); |
| 15884 | 651 | else if(conv->type==PURPLE_CONV_TYPE_CHAT) |
|
12018
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
652 | chats = g_list_remove(chats, conv); |
|
60a434403f7e
[gaim-migrate @ 14311]
Casey Harkins <charkins@pidgin.im>
parents:
11921
diff
changeset
|
653 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
654 | hc.name = (gchar *)purple_normalize(conv->account, conv->name); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
655 | hc.account = conv->account; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
656 | hc.type = conv->type; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
657 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
658 | g_hash_table_remove(conversation_cache, &hc); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
659 | |
| 15884 | 660 | purple_signal_emit(purple_conversations_get_handle(), |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
661 | "deleting-conversation", conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
662 | |
| 11606 | 663 | g_free(conv->name); |
| 664 | g_free(conv->title); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
665 | |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
666 | conv->name = NULL; |
|
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
667 | conv->title = NULL; |
|
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
668 | |
| 15884 | 669 | if (conv->type == PURPLE_CONV_TYPE_IM) { |
| 670 | purple_conv_im_stop_typing_timeout(conv->u.im); | |
| 671 | purple_conv_im_stop_send_typed_timeout(conv->u.im); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
672 | |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
673 | purple_buddy_icon_unref(conv->u.im->icon); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
674 | conv->u.im->icon = NULL; |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
675 | |
| 15884 | 676 | PURPLE_DBUS_UNREGISTER_POINTER(conv->u.im); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
677 | g_free(conv->u.im); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
678 | conv->u.im = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
679 | } |
| 15884 | 680 | else if (conv->type == PURPLE_CONV_TYPE_CHAT) { |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
681 | g_hash_table_destroy(conv->u.chat->users); |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
682 | conv->u.chat->users = NULL; |
| 15884 | 683 | |
| 684 | g_list_foreach(conv->u.chat->in_room, (GFunc)purple_conv_chat_cb_destroy, NULL); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
685 | g_list_free(conv->u.chat->in_room); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
686 | |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
687 | g_list_foreach(conv->u.chat->ignored, (GFunc)g_free, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
688 | g_list_free(conv->u.chat->ignored); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
689 | |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
690 | conv->u.chat->in_room = NULL; |
|
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
691 | conv->u.chat->ignored = NULL; |
|
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
692 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
693 | g_free(conv->u.chat->who); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
694 | conv->u.chat->who = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
695 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
696 | g_free(conv->u.chat->topic); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
697 | conv->u.chat->topic = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
698 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
699 | g_free(conv->u.chat->nick); |
|
10504
eae130eefbfe
[gaim-migrate @ 11796]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10385
diff
changeset
|
700 | |
| 15884 | 701 | PURPLE_DBUS_UNREGISTER_POINTER(conv->u.chat); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
702 | g_free(conv->u.chat); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
703 | conv->u.chat = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
704 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
705 | |
|
4877
7d1f4381fed0
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
706 | g_hash_table_destroy(conv->data); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
707 | conv->data = NULL; |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
708 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
709 | if (ops != NULL && ops->destroy_conversation != NULL) |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
710 | ops->destroy_conversation(conv); |
|
31643
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
711 | conv->ui_data = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
712 | |
| 15884 | 713 | purple_conversation_close_logs(conv); |
| 714 | ||
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
715 | purple_conversation_clear_message_history(conv); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
716 | |
| 15884 | 717 | PURPLE_DBUS_UNREGISTER_POINTER(conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
718 | g_free(conv); |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
719 | conv = NULL; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
720 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
721 | |
| 10665 | 722 | |
| 723 | void | |
| 15884 | 724 | purple_conversation_present(PurpleConversation *conv) { |
| 725 | PurpleConversationUiOps *ops; | |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
726 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
727 | g_return_if_fail(conv != NULL); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
728 | |
| 15884 | 729 | ops = purple_conversation_get_ui_ops(conv); |
|
12624
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
730 | if(ops && ops->present) |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
731 | ops->present(conv); |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
732 | } |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
733 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
734 | |
|
c1c92f08976b
[gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents:
12618
diff
changeset
|
735 | void |
| 15884 | 736 | purple_conversation_set_features(PurpleConversation *conv, PurpleConnectionFlags features) |
| 10665 | 737 | { |
| 738 | g_return_if_fail(conv != NULL); | |
| 739 | ||
| 740 | conv->features = features; | |
| 741 | ||
| 15884 | 742 | purple_conversation_update(conv, PURPLE_CONV_UPDATE_FEATURES); |
| 10665 | 743 | } |
| 744 | ||
| 745 | ||
| 15884 | 746 | PurpleConnectionFlags |
| 747 | purple_conversation_get_features(PurpleConversation *conv) | |
| 10665 | 748 | { |
| 749 | g_return_val_if_fail(conv != NULL, 0); | |
| 750 | return conv->features; | |
| 751 | } | |
| 752 | ||
| 753 | ||
| 15884 | 754 | PurpleConversationType |
| 755 | purple_conversation_get_type(const PurpleConversation *conv) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
756 | { |
| 15884 | 757 | g_return_val_if_fail(conv != NULL, PURPLE_CONV_TYPE_UNKNOWN); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
758 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
759 | return conv->type; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
760 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
761 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
762 | void |
| 15884 | 763 | purple_conversation_set_ui_ops(PurpleConversation *conv, |
| 764 | PurpleConversationUiOps *ops) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
765 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
766 | g_return_if_fail(conv != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
767 | |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
768 | if (conv->ui_ops == ops) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
769 | return; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
770 | |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
771 | if (conv->ui_ops != NULL && conv->ui_ops->destroy_conversation != NULL) |
|
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
772 | conv->ui_ops->destroy_conversation(conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
773 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
774 | conv->ui_data = NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
775 | |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
776 | conv->ui_ops = ops; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
777 | } |
| 66 | 778 | |
| 15884 | 779 | PurpleConversationUiOps * |
| 780 | purple_conversation_get_ui_ops(const PurpleConversation *conv) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
781 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
782 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
783 | |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
784 | return conv->ui_ops; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
785 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
786 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
787 | void |
| 15884 | 788 | purple_conversation_set_account(PurpleConversation *conv, PurpleAccount *account) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
789 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
790 | g_return_if_fail(conv != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
791 | |
| 15884 | 792 | if (account == purple_conversation_get_account(conv)) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
793 | return; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
794 | |
| 4491 | 795 | conv->account = account; |
| 796 | ||
| 15884 | 797 | purple_conversation_update(conv, PURPLE_CONV_UPDATE_ACCOUNT); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
798 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
799 | |
| 15884 | 800 | PurpleAccount * |
| 801 | purple_conversation_get_account(const PurpleConversation *conv) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
802 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
803 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
804 | |
| 4491 | 805 | return conv->account; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
806 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
807 | |
| 15884 | 808 | PurpleConnection * |
| 809 | purple_conversation_get_gc(const PurpleConversation *conv) | |
| 66 | 810 | { |
| 15884 | 811 | PurpleAccount *account; |
|
4425
b2ccc08ed727
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
812 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
813 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
814 | |
| 15884 | 815 | account = purple_conversation_get_account(conv); |
| 4491 | 816 | |
| 817 | if (account == NULL) | |
|
4425
b2ccc08ed727
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
818 | return NULL; |
|
b2ccc08ed727
[gaim-migrate @ 4700]
Christian Hammond <chipx86@chipx86.com>
parents:
4415
diff
changeset
|
819 | |
|
32624
f957ad287bcc
Convert code to use the purple_account accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32623
diff
changeset
|
820 | return purple_account_get_connection(account); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
821 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
822 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
823 | void |
| 15884 | 824 | purple_conversation_set_title(PurpleConversation *conv, const char *title) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
825 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
826 | g_return_if_fail(conv != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
827 | g_return_if_fail(title != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
828 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
829 | g_free(conv->title); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
830 | conv->title = g_strdup(title); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
831 | |
| 15884 | 832 | purple_conversation_update(conv, PURPLE_CONV_UPDATE_TITLE); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
833 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
834 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
835 | const char * |
| 15884 | 836 | purple_conversation_get_title(const PurpleConversation *conv) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
837 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
838 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
839 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
840 | return conv->title; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
841 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
842 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
843 | void |
| 15884 | 844 | purple_conversation_autoset_title(PurpleConversation *conv) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
845 | { |
| 15884 | 846 | PurpleAccount *account; |
| 847 | PurpleBuddy *b; | |
| 848 | PurpleChat *chat; | |
| 8015 | 849 | const char *text = NULL, *name; |
| 3799 | 850 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
851 | g_return_if_fail(conv != NULL); |
|
2267
9704c0f60689
[gaim-migrate @ 2277]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2264
diff
changeset
|
852 | |
| 15884 | 853 | account = purple_conversation_get_account(conv); |
| 854 | name = purple_conversation_get_name(conv); | |
| 855 | ||
| 856 | if(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { | |
| 857 | if(account && ((b = purple_find_buddy(account, name)) != NULL)) | |
| 858 | text = purple_buddy_get_contact_alias(b); | |
| 859 | } else if(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { | |
| 860 | if(account && ((chat = purple_blist_find_chat(account, name)) != NULL)) | |
|
24955
77727fac30c6
Finish off the libpurple updates for the hidden blist structs
Gary Kramlich <grim@reaperworld.com>
parents:
24051
diff
changeset
|
861 | text = purple_chat_get_name(chat); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
862 | } |
| 11581 | 863 | |
| 8015 | 864 | |
|
10116
054b064145a1
[gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10104
diff
changeset
|
865 | if(text == NULL) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
866 | text = name; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
867 | |
| 15884 | 868 | purple_conversation_set_title(conv, text); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
869 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
870 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
871 | void |
| 15884 | 872 | purple_conversation_foreach(void (*func)(PurpleConversation *conv)) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
873 | { |
| 15884 | 874 | PurpleConversation *conv; |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
875 | GList *l; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
876 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
877 | g_return_if_fail(func != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
878 | |
| 15884 | 879 | for (l = purple_get_conversations(); l != NULL; l = l->next) { |
| 880 | conv = (PurpleConversation *)l->data; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
881 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
882 | func(conv); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
883 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
884 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
885 | |
|
7256
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
886 | void |
| 15884 | 887 | purple_conversation_set_name(PurpleConversation *conv, const char *name) |
|
7256
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
888 | { |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
889 | struct _purple_hconv *hc; |
|
7256
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
890 | g_return_if_fail(conv != NULL); |
|
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
891 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
892 | hc = g_new(struct _purple_hconv, 1); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
893 | hc->type = conv->type; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
894 | hc->account = conv->account; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
895 | hc->name = (gchar *)purple_normalize(conv->account, conv->name); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
896 | |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
897 | g_hash_table_remove(conversation_cache, hc); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
898 | g_free(conv->name); |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
899 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
900 | conv->name = g_strdup(name); |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
901 | hc->name = g_strdup(purple_normalize(conv->account, conv->name)); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
902 | g_hash_table_insert(conversation_cache, hc, conv); |
|
7257
599b8494e6ee
[gaim-migrate @ 7834]
Christian Hammond <chipx86@chipx86.com>
parents:
7256
diff
changeset
|
903 | |
| 15884 | 904 | purple_conversation_autoset_title(conv); |
|
7256
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
905 | } |
|
311c8febfc92
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7125
diff
changeset
|
906 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
907 | const char * |
| 15884 | 908 | purple_conversation_get_name(const PurpleConversation *conv) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
909 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
910 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
911 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
912 | return conv->name; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
913 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
914 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
915 | void |
| 15884 | 916 | purple_conversation_set_logging(PurpleConversation *conv, gboolean log) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
917 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
918 | g_return_if_fail(conv != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
919 | |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
920 | if (conv->logging != log) |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
921 | { |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
922 | conv->logging = log; |
| 15884 | 923 | purple_conversation_update(conv, PURPLE_CONV_UPDATE_LOGGING); |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
924 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
925 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
926 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
927 | gboolean |
| 15884 | 928 | purple_conversation_is_logging(const PurpleConversation *conv) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
929 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
930 | g_return_val_if_fail(conv != NULL, FALSE); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
931 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
932 | return conv->logging; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
933 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
934 | |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
935 | void |
| 15884 | 936 | purple_conversation_close_logs(PurpleConversation *conv) |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
937 | { |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
938 | g_return_if_fail(conv != NULL); |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
939 | |
| 15884 | 940 | g_list_foreach(conv->logs, (GFunc)purple_log_free, NULL); |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
941 | g_list_free(conv->logs); |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
942 | conv->logs = NULL; |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
943 | } |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
944 | |
| 15884 | 945 | PurpleConvIm * |
| 946 | purple_conversation_get_im_data(const PurpleConversation *conv) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
947 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
948 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
949 | |
| 15884 | 950 | if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
951 | return NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
952 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
953 | return conv->u.im; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
954 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
955 | |
| 15884 | 956 | PurpleConvChat * |
| 957 | purple_conversation_get_chat_data(const PurpleConversation *conv) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
958 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
959 | g_return_val_if_fail(conv != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
960 | |
| 15884 | 961 | if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
962 | return NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
963 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
964 | return conv->u.chat; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
965 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
966 | |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
967 | void |
| 15884 | 968 | purple_conversation_set_data(PurpleConversation *conv, const char *key, |
|
4877
7d1f4381fed0
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
969 | gpointer data) |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
970 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
971 | g_return_if_fail(conv != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
972 | g_return_if_fail(key != NULL); |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
973 | |
|
4877
7d1f4381fed0
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
974 | g_hash_table_replace(conv->data, g_strdup(key), data); |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
975 | } |
|
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
976 | |
|
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
977 | gpointer |
| 15884 | 978 | purple_conversation_get_data(PurpleConversation *conv, const char *key) |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
979 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
980 | g_return_val_if_fail(conv != NULL, NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
981 | g_return_val_if_fail(key != NULL, NULL); |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
982 | |
|
4877
7d1f4381fed0
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
983 | return g_hash_table_lookup(conv->data, key); |
|
4876
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
984 | } |
|
b6ec886c8c77
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4818
diff
changeset
|
985 | |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
986 | GList * |
| 15884 | 987 | purple_get_conversations(void) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
988 | { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
989 | return conversations; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
990 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
991 | |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
992 | GList * |
| 15884 | 993 | purple_get_ims(void) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
994 | { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
995 | return ims; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
996 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
997 | |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
998 | GList * |
| 15884 | 999 | purple_get_chats(void) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1000 | { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1001 | return chats; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1002 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1003 | |
| 7261 | 1004 | |
| 15884 | 1005 | PurpleConversation * |
| 1006 | purple_find_conversation_with_account(PurpleConversationType type, | |
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10132
diff
changeset
|
1007 | const char *name, |
| 15884 | 1008 | const PurpleAccount *account) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1009 | { |
| 15884 | 1010 | PurpleConversation *c = NULL; |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1011 | struct _purple_hconv hc; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1012 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1013 | g_return_val_if_fail(name != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1014 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1015 | hc.name = (gchar *)purple_normalize(account, name); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1016 | hc.account = account; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1017 | hc.type = type; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1018 | |
|
22987
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1019 | switch (type) { |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1020 | case PURPLE_CONV_TYPE_IM: |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1021 | case PURPLE_CONV_TYPE_CHAT: |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1022 | c = g_hash_table_lookup(conversation_cache, &hc); |
|
22987
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1023 | break; |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1024 | case PURPLE_CONV_TYPE_ANY: |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1025 | hc.type = PURPLE_CONV_TYPE_IM; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1026 | c = g_hash_table_lookup(conversation_cache, &hc); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1027 | if (!c) { |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1028 | hc.type = PURPLE_CONV_TYPE_CHAT; |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1029 | c = g_hash_table_lookup(conversation_cache, &hc); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
1030 | } |
|
22987
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1031 | break; |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1032 | default: |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1033 | g_return_val_if_reached(NULL); |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1034 | } |
|
4cd9b9d34a4e
When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22918
diff
changeset
|
1035 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1036 | return c; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1037 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1038 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1039 | void |
| 15884 | 1040 | purple_conversation_write(PurpleConversation *conv, const char *who, |
| 1041 | const char *message, PurpleMessageFlags flags, | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1042 | time_t mtime) |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1043 | { |
| 15884 | 1044 | PurplePluginProtocolInfo *prpl_info = NULL; |
| 1045 | PurpleConnection *gc = NULL; | |
| 1046 | PurpleAccount *account; | |
| 1047 | PurpleConversationUiOps *ops; | |
|
11468
3411c0d7f597
[gaim-migrate @ 13708]
Richard Laager <rlaager@pidgin.im>
parents:
11454
diff
changeset
|
1048 | const char *alias; |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1049 | char *displayed = NULL; |
| 15884 | 1050 | PurpleBuddy *b; |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1051 | int plugin_return; |
| 15884 | 1052 | PurpleConversationType type; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1053 | /* int logging_font_options = 0; */ |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1054 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1055 | g_return_if_fail(conv != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1056 | g_return_if_fail(message != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1057 | |
| 15884 | 1058 | ops = purple_conversation_get_ui_ops(conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1059 | |
| 15884 | 1060 | account = purple_conversation_get_account(conv); |
| 1061 | type = purple_conversation_get_type(conv); | |
|
6496
9833c2665143
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1062 | |
|
9833c2665143
[gaim-migrate @ 7011]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
1063 | if (account != NULL) |
| 15884 | 1064 | gc = purple_account_get_connection(account); |
| 1065 | ||
| 1066 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT && | |
|
22805
92825aac9549
When you try to execute a command (e.g., /part etc.) in a chat on a
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22458
diff
changeset
|
1067 | (gc != NULL && !g_slist_find(gc->buddy_chats, conv))) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1068 | return; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1069 | |
| 15884 | 1070 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1071 | !g_list_find(purple_get_conversations(), conv)) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1072 | return; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1073 | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1074 | displayed = g_strdup(message); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1075 | |
|
19769
9420f2078435
writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@pidgin.im>
parents:
19674
diff
changeset
|
1076 | if (who == NULL || *who == '\0') |
|
9420f2078435
writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@pidgin.im>
parents:
19674
diff
changeset
|
1077 | who = purple_conversation_get_name(conv); |
|
9420f2078435
writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@pidgin.im>
parents:
19674
diff
changeset
|
1078 | alias = who; |
|
9420f2078435
writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@pidgin.im>
parents:
19674
diff
changeset
|
1079 | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1080 | plugin_return = |
| 15884 | 1081 | GPOINTER_TO_INT(purple_signal_emit_return_1( |
| 1082 | purple_conversations_get_handle(), | |
| 1083 | (type == PURPLE_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"), | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1084 | account, who, &displayed, conv, flags)); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1085 | |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1086 | if (displayed == NULL) |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1087 | return; |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1088 | |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1089 | if (plugin_return) { |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1090 | g_free(displayed); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1091 | return; |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1092 | } |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1093 | |
| 9613 | 1094 | if (account != NULL) { |
| 15884 | 1095 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account))); |
| 1096 | ||
| 1097 | if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM || | |
|
5350
966c6d4d7bdd
[gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents:
5262
diff
changeset
|
1098 | !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
966c6d4d7bdd
[gaim-migrate @ 5726]
Christian Hammond <chipx86@chipx86.com>
parents:
5262
diff
changeset
|
1099 | |
| 15884 | 1100 | if (flags & PURPLE_MESSAGE_SEND) { |
| 1101 | b = purple_find_buddy(account, | |
| 1102 | purple_account_get_username(account)); | |
| 1103 | ||
| 1104 | if (purple_account_get_alias(account) != NULL) | |
|
32623
547eacef0b63
Convert libpurple and protocol prpl's to use the purple_account_* accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32621
diff
changeset
|
1105 | alias = purple_account_get_alias(account); |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24955
diff
changeset
|
1106 | else if (b != NULL && !purple_strequal(purple_buddy_get_name(b), purple_buddy_get_contact_alias(b))) |
| 15884 | 1107 | alias = purple_buddy_get_contact_alias(b); |
| 1108 | else if (purple_connection_get_display_name(gc) != NULL) | |
| 1109 | alias = purple_connection_get_display_name(gc); | |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1110 | else |
| 15884 | 1111 | alias = purple_account_get_username(account); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1112 | } |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1113 | else |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1114 | { |
| 15884 | 1115 | b = purple_find_buddy(account, who); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1116 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1117 | if (b != NULL) |
| 15884 | 1118 | alias = purple_buddy_get_contact_alias(b); |
|
1772
c759c01bd66f
[gaim-migrate @ 1782]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1764
diff
changeset
|
1119 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1120 | } |
|
474
8e9acf2f6c48
[gaim-migrate @ 484]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
473
diff
changeset
|
1121 | } |
| 8256 | 1122 | |
| 15884 | 1123 | if (!(flags & PURPLE_MESSAGE_NO_LOG) && purple_conversation_is_logging(conv)) { |
|
11672
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1124 | GList *log; |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1125 | |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1126 | if (conv->logs == NULL) |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1127 | open_log(conv); |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1128 | |
|
018c70c8134c
[gaim-migrate @ 13958]
Richard Laager <rlaager@pidgin.im>
parents:
11671
diff
changeset
|
1129 | log = conv->logs; |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1130 | while (log != NULL) { |
| 15884 | 1131 | purple_log_write((PurpleLog *)log->data, flags, alias, mtime, displayed); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1132 | log = log->next; |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1133 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1134 | } |
| 66 | 1135 | |
|
19593
608995889b11
A conversation shouldn't need ui-ops for logging the messages.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19590
diff
changeset
|
1136 | if (ops && ops->write_conv) |
|
608995889b11
A conversation shouldn't need ui-ops for logging the messages.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19590
diff
changeset
|
1137 | ops->write_conv(conv, who, alias, displayed, flags, mtime); |
|
21253
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
1138 | |
|
121075afcdbc
Show alias in restored conversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21233
diff
changeset
|
1139 | add_message_to_history(conv, who, alias, message, flags, mtime); |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1140 | |
| 15884 | 1141 | purple_signal_emit(purple_conversations_get_handle(), |
| 1142 | (type == PURPLE_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"), | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1143 | account, who, displayed, conv, flags); |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1144 | |
|
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
1145 | g_free(displayed); |
| 66 | 1146 | } |
| 1147 | ||
|
9260
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1148 | gboolean |
| 15884 | 1149 | purple_conversation_has_focus(PurpleConversation *conv) |
|
9260
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1150 | { |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1151 | gboolean ret = FALSE; |
| 15884 | 1152 | PurpleConversationUiOps *ops; |
|
9260
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1153 | |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1154 | g_return_val_if_fail(conv != NULL, FALSE); |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1155 | |
| 15884 | 1156 | ops = purple_conversation_get_ui_ops(conv); |
|
9260
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1157 | |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1158 | if (ops != NULL && ops->has_focus != NULL) |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1159 | ret = ops->has_focus(conv); |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1160 | |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1161 | return ret; |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1162 | } |
|
82d7b380220a
[gaim-migrate @ 10059]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9251
diff
changeset
|
1163 | |
|
7930
3005873ac411
[gaim-migrate @ 8601]
Mark Doliner <markdoliner@pidgin.im>
parents:
7879
diff
changeset
|
1164 | /* |
| 8256 | 1165 | * TODO: Need to make sure calls to this function happen in the core |
| 1166 | * instead of the UI. That way UIs have less work to do, and the | |
| 1167 | * core/UI split is cleaner. Also need to make sure this is called | |
|
7930
3005873ac411
[gaim-migrate @ 8601]
Mark Doliner <markdoliner@pidgin.im>
parents:
7879
diff
changeset
|
1168 | * when chats are added/removed from the blist. |
|
3005873ac411
[gaim-migrate @ 8601]
Mark Doliner <markdoliner@pidgin.im>
parents:
7879
diff
changeset
|
1169 | */ |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1170 | void |
| 15884 | 1171 | purple_conversation_update(PurpleConversation *conv, PurpleConvUpdateType type) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1172 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1173 | g_return_if_fail(conv != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1174 | |
| 15884 | 1175 | purple_signal_emit(purple_conversations_get_handle(), |
| 9734 | 1176 | "conversation-updated", conv, type); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1177 | } |
| 2993 | 1178 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1179 | /************************************************************************** |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1180 | * IM Conversation API |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1181 | **************************************************************************/ |
| 15884 | 1182 | PurpleConversation * |
| 1183 | purple_conv_im_get_conversation(const PurpleConvIm *im) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1184 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1185 | g_return_val_if_fail(im != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1186 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1187 | return im->conv; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1188 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1189 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1190 | void |
| 15884 | 1191 | purple_conv_im_set_icon(PurpleConvIm *im, PurpleBuddyIcon *icon) |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1192 | { |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1193 | g_return_if_fail(im != NULL); |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1194 | |
|
9261
a0ed867a459e
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
1195 | if (im->icon != icon) |
|
a0ed867a459e
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
1196 | { |
|
16421
f9218e1c4703
The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
1197 | purple_buddy_icon_unref(im->icon); |
| 15884 | 1198 | |
| 1199 | im->icon = (icon == NULL ? NULL : purple_buddy_icon_ref(icon)); | |
|
9261
a0ed867a459e
[gaim-migrate @ 10060]
Christian Hammond <chipx86@chipx86.com>
parents:
9260
diff
changeset
|
1200 | } |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1201 | |
| 15884 | 1202 | purple_conversation_update(purple_conv_im_get_conversation(im), |
| 1203 | PURPLE_CONV_UPDATE_ICON); | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1204 | } |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1205 | |
| 15884 | 1206 | PurpleBuddyIcon * |
| 1207 | purple_conv_im_get_icon(const PurpleConvIm *im) | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1208 | { |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1209 | g_return_val_if_fail(im != NULL, NULL); |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1210 | |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1211 | return im->icon; |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1212 | } |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1213 | |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
1214 | void |
| 15884 | 1215 | purple_conv_im_set_typing_state(PurpleConvIm *im, PurpleTypingState state) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1216 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1217 | g_return_if_fail(im != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1218 | |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1219 | if (im->typing_state != state) |
|
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1220 | { |
|
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1221 | im->typing_state = state; |
|
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1222 | |
|
17106
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1223 | switch (state) |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1224 | { |
|
17106
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1225 | case PURPLE_TYPING: |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1226 | purple_signal_emit(purple_conversations_get_handle(), |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1227 | "buddy-typing", im->conv->account, im->conv->name); |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1228 | break; |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1229 | case PURPLE_TYPED: |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1230 | purple_signal_emit(purple_conversations_get_handle(), |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1231 | "buddy-typed", im->conv->account, im->conv->name); |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1232 | break; |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1233 | case PURPLE_NOT_TYPING: |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1234 | purple_signal_emit(purple_conversations_get_handle(), |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1235 | "buddy-typing-stopped", im->conv->account, im->conv->name); |
|
acef708c4ebc
Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evands@pidgin.im>
parents:
16900
diff
changeset
|
1236 | break; |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1237 | } |
|
27250
47fc0f87ce94
Consistently emit conversation-updated for typing state changes.
Florian Quèze <florian@instantbird.org>
parents:
26889
diff
changeset
|
1238 | |
|
47fc0f87ce94
Consistently emit conversation-updated for typing state changes.
Florian Quèze <florian@instantbird.org>
parents:
26889
diff
changeset
|
1239 | purple_conv_im_update_typing(im); |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12639
diff
changeset
|
1240 | } |
| 2993 | 1241 | } |
| 66 | 1242 | |
| 15884 | 1243 | PurpleTypingState |
| 1244 | purple_conv_im_get_typing_state(const PurpleConvIm *im) | |
| 3671 | 1245 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1246 | g_return_val_if_fail(im != NULL, 0); |
| 3671 | 1247 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1248 | return im->typing_state; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1249 | } |
| 3704 | 1250 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1251 | void |
| 15884 | 1252 | purple_conv_im_start_typing_timeout(PurpleConvIm *im, int timeout) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1253 | { |
| 15884 | 1254 | PurpleConversation *conv; |
| 3671 | 1255 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1256 | g_return_if_fail(im != NULL); |
| 3671 | 1257 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1258 | if (im->typing_timeout > 0) |
| 15884 | 1259 | purple_conv_im_stop_typing_timeout(im); |
| 1260 | ||
| 1261 | conv = purple_conv_im_get_conversation(im); | |
| 1262 | ||
|
18068
b6554e3c8224
merge of '1442df274a24edc9a31194327bd00dfbcf478720'
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
1263 | im->typing_timeout = purple_timeout_add_seconds(timeout, reset_typing_cb, conv); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1264 | } |
| 3671 | 1265 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1266 | void |
| 15884 | 1267 | purple_conv_im_stop_typing_timeout(PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1268 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1269 | g_return_if_fail(im != NULL); |
| 3671 | 1270 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1271 | if (im->typing_timeout == 0) |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1272 | return; |
| 3671 | 1273 | |
| 15884 | 1274 | purple_timeout_remove(im->typing_timeout); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1275 | im->typing_timeout = 0; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1276 | } |
| 3671 | 1277 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1278 | guint |
| 15884 | 1279 | purple_conv_im_get_typing_timeout(const PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1280 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1281 | g_return_val_if_fail(im != NULL, 0); |
| 3699 | 1282 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1283 | return im->typing_timeout; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1284 | } |
| 3699 | 1285 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1286 | void |
| 15884 | 1287 | purple_conv_im_set_type_again(PurpleConvIm *im, unsigned int val) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1288 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1289 | g_return_if_fail(im != NULL); |
| 3671 | 1290 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1291 | if (val == 0) |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1292 | im->type_again = 0; |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1293 | else |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1294 | im->type_again = time(NULL) + val; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1295 | } |
| 3671 | 1296 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1297 | time_t |
| 15884 | 1298 | purple_conv_im_get_type_again(const PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1299 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1300 | g_return_val_if_fail(im != NULL, 0); |
| 3671 | 1301 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1302 | return im->type_again; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1303 | } |
| 3671 | 1304 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1305 | void |
| 15884 | 1306 | purple_conv_im_start_send_typed_timeout(PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1307 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1308 | g_return_if_fail(im != NULL); |
| 3671 | 1309 | |
|
25716
1b5be208d5ba
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
24051
diff
changeset
|
1310 | im->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS, |
|
1b5be208d5ba
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
24051
diff
changeset
|
1311 | send_typed_cb, |
|
1b5be208d5ba
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
24051
diff
changeset
|
1312 | purple_conv_im_get_conversation(im)); |
| 3671 | 1313 | } |
| 1314 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1315 | void |
| 15884 | 1316 | purple_conv_im_stop_send_typed_timeout(PurpleConvIm *im) |
| 3671 | 1317 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1318 | g_return_if_fail(im != NULL); |
| 3671 | 1319 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1320 | if (im->send_typed_timeout == 0) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1321 | return; |
| 3671 | 1322 | |
| 15884 | 1323 | purple_timeout_remove(im->send_typed_timeout); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1324 | im->send_typed_timeout = 0; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1325 | } |
| 3671 | 1326 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1327 | guint |
| 15884 | 1328 | purple_conv_im_get_send_typed_timeout(const PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1329 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1330 | g_return_val_if_fail(im != NULL, 0); |
| 3671 | 1331 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13840
diff
changeset
|
1332 | return im->send_typed_timeout; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1333 | } |
| 3671 | 1334 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1335 | void |
| 15884 | 1336 | purple_conv_im_update_typing(PurpleConvIm *im) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1337 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1338 | g_return_if_fail(im != NULL); |
| 3671 | 1339 | |
| 15884 | 1340 | purple_conversation_update(purple_conv_im_get_conversation(im), |
| 1341 | PURPLE_CONV_UPDATE_TYPING); | |
| 3671 | 1342 | } |
| 1343 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1344 | void |
| 15884 | 1345 | purple_conv_im_write(PurpleConvIm *im, const char *who, const char *message, |
| 1346 | PurpleMessageFlags flags, time_t mtime) | |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1347 | { |
| 15884 | 1348 | PurpleConversation *c; |
|
1898
695a31e4452b
[gaim-migrate @ 1908]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1889
diff
changeset
|
1349 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1350 | g_return_if_fail(im != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1351 | g_return_if_fail(message != NULL); |
|
1898
695a31e4452b
[gaim-migrate @ 1908]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1889
diff
changeset
|
1352 | |
| 15884 | 1353 | c = purple_conv_im_get_conversation(im); |
|
2787
050506d3945f
[gaim-migrate @ 2800]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2773
diff
changeset
|
1354 | |
|
31602
968e936bc122
Fix indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31565
diff
changeset
|
1355 | if ((flags & PURPLE_MESSAGE_RECV) == PURPLE_MESSAGE_RECV) { |
|
31449
2c75e32cecc6
applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evands@pidgin.im>
parents:
31448
diff
changeset
|
1356 | purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING); |
|
2c75e32cecc6
applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evands@pidgin.im>
parents:
31448
diff
changeset
|
1357 | } |
|
2c75e32cecc6
applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evands@pidgin.im>
parents:
31448
diff
changeset
|
1358 | |
|
19118
c242294f21d1
Correct an inaccurate comment.
Will Thompson <resiak@pidgin.im>
parents:
18744
diff
changeset
|
1359 | /* Pass this on to either the ops structure or the default write func. */ |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1360 | if (c->ui_ops != NULL && c->ui_ops->write_im != NULL) |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6846
diff
changeset
|
1361 | c->ui_ops->write_im(c, who, message, flags, mtime); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1362 | else |
| 15884 | 1363 | purple_conversation_write(c, who, message, flags, mtime); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1364 | } |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1365 | |
| 15884 | 1366 | gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what) |
| 9627 | 1367 | { |
| 15884 | 1368 | PurpleConversation *conv; |
| 9627 | 1369 | |
| 1370 | g_return_val_if_fail(who != NULL, FALSE); | |
| 1371 | g_return_val_if_fail(account !=NULL, FALSE); | |
| 1372 | g_return_val_if_fail(what != NULL, FALSE); | |
| 1373 | ||
| 15884 | 1374 | conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, account); |
| 9627 | 1375 | if (conv != NULL) |
| 15884 | 1376 | purple_conversation_write(conv, NULL, what, PURPLE_MESSAGE_ERROR, time(NULL)); |
| 9627 | 1377 | else |
| 1378 | return FALSE; | |
| 1379 | ||
| 1380 | return TRUE; | |
| 1381 | } | |
| 1382 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1383 | void |
| 15884 | 1384 | purple_conv_im_send(PurpleConvIm *im, const char *message) |
|
2379
cffc8ebf1bd4
[gaim-migrate @ 2392]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2375
diff
changeset
|
1385 | { |
| 15884 | 1386 | purple_conv_im_send_with_flags(im, message, 0); |
|
11921
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1387 | } |
|
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1388 | |
| 14582 | 1389 | static void |
| 15884 | 1390 | purple_conv_send_confirm_cb(gpointer *data) |
| 14582 | 1391 | { |
| 15884 | 1392 | PurpleConversation *conv = data[0]; |
| 14582 | 1393 | char *message = data[1]; |
| 1394 | ||
| 1395 | g_free(data); | |
| 1396 | common_send(conv, message, 0); | |
| 1397 | } | |
| 1398 | ||
| 1399 | void | |
| 15884 | 1400 | purple_conv_send_confirm(PurpleConversation *conv, const char *message) |
| 14582 | 1401 | { |
| 1402 | char *text; | |
| 1403 | gpointer *data; | |
| 1404 | ||
| 1405 | g_return_if_fail(conv != NULL); | |
| 1406 | g_return_if_fail(message != NULL); | |
| 1407 | ||
| 1408 | if (conv->ui_ops != NULL && conv->ui_ops->send_confirm != NULL) | |
| 1409 | { | |
| 1410 | conv->ui_ops->send_confirm(conv, message); | |
| 1411 | return; | |
| 1412 | } | |
| 1413 | ||
| 1414 | text = g_strdup_printf("You are about to send the following message:\n%s", message); | |
| 1415 | data = g_new0(gpointer, 2); | |
| 1416 | data[0] = conv; | |
| 1417 | data[1] = (gpointer)message; | |
| 1418 | ||
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1419 | purple_request_action(conv, NULL, _("Send Message"), text, 0, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
1420 | purple_conversation_get_account(conv), NULL, conv, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
1421 | data, 2, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
1422 | _("_Send Message"), G_CALLBACK(purple_conv_send_confirm_cb), |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16478
diff
changeset
|
1423 | _("Cancel"), NULL); |
| 14582 | 1424 | } |
| 1425 | ||
|
11921
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1426 | void |
| 15884 | 1427 | purple_conv_im_send_with_flags(PurpleConvIm *im, const char *message, PurpleMessageFlags flags) |
|
11921
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1428 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1429 | g_return_if_fail(im != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1430 | g_return_if_fail(message != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1431 | |
| 15884 | 1432 | common_send(purple_conv_im_get_conversation(im), message, flags); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1433 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1434 | |
| 10526 | 1435 | gboolean |
| 15884 | 1436 | purple_conv_custom_smiley_add(PurpleConversation *conv, const char *smile, |
|
12618
b83b6bab0703
[gaim-migrate @ 14954]
Richard Laager <rlaager@pidgin.im>
parents:
12604
diff
changeset
|
1437 | const char *cksum_type, const char *chksum, |
|
b83b6bab0703
[gaim-migrate @ 14954]
Richard Laager <rlaager@pidgin.im>
parents:
12604
diff
changeset
|
1438 | gboolean remote) |
| 10526 | 1439 | { |
| 1440 | if (conv == NULL || smile == NULL || !*smile) { | |
| 1441 | return FALSE; | |
| 1442 | } | |
| 1443 | ||
| 1444 | /* TODO: check if the icon is in the cache and return false if so */ | |
| 1445 | /* TODO: add an icon cache (that doesn't suck) */ | |
| 1446 | if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_add !=NULL) { | |
|
12618
b83b6bab0703
[gaim-migrate @ 14954]
Richard Laager <rlaager@pidgin.im>
parents:
12604
diff
changeset
|
1447 | return conv->ui_ops->custom_smiley_add(conv, smile, remote); |
| 10526 | 1448 | } else { |
| 15884 | 1449 | purple_debug_info("conversation", "Could not find add custom smiley function"); |
| 10526 | 1450 | return FALSE; |
| 1451 | } | |
| 1452 | ||
| 1453 | } | |
| 1454 | ||
| 1455 | void | |
| 15884 | 1456 | purple_conv_custom_smiley_write(PurpleConversation *conv, const char *smile, |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11064
diff
changeset
|
1457 | const guchar *data, gsize size) |
| 10526 | 1458 | { |
| 1459 | g_return_if_fail(conv != NULL); | |
| 1460 | g_return_if_fail(smile != NULL && *smile); | |
| 1461 | ||
| 1462 | if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_write != NULL) | |
| 1463 | conv->ui_ops->custom_smiley_write(conv, smile, data, size); | |
| 1464 | else | |
| 15884 | 1465 | purple_debug_info("conversation", "Could not find the smiley write function"); |
| 10526 | 1466 | } |
| 1467 | ||
| 1468 | void | |
| 15884 | 1469 | purple_conv_custom_smiley_close(PurpleConversation *conv, const char *smile) |
| 10526 | 1470 | { |
| 1471 | g_return_if_fail(conv != NULL); | |
| 1472 | g_return_if_fail(smile != NULL && *smile); | |
| 1473 | ||
| 1474 | if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_close != NULL) | |
| 1475 | conv->ui_ops->custom_smiley_close(conv, smile); | |
| 1476 | else | |
| 15884 | 1477 | purple_debug_info("conversation", "Could not find custom smiley close function"); |
| 10526 | 1478 | } |
| 1479 | ||
| 1480 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1481 | /************************************************************************** |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1482 | * Chat Conversation API |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1483 | **************************************************************************/ |
|
2379
cffc8ebf1bd4
[gaim-migrate @ 2392]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2375
diff
changeset
|
1484 | |
| 15884 | 1485 | PurpleConversation * |
| 1486 | purple_conv_chat_get_conversation(const PurpleConvChat *chat) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1487 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1488 | g_return_val_if_fail(chat != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1489 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1490 | return chat->conv; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1491 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1492 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1493 | GList * |
| 15884 | 1494 | purple_conv_chat_get_users(const PurpleConvChat *chat) |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1495 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1496 | g_return_val_if_fail(chat != NULL, NULL); |
|
1253
f02697a6aada
[gaim-migrate @ 1263]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
1497 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1498 | return chat->in_room; |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1499 | } |
|
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1002
diff
changeset
|
1500 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1501 | void |
| 15884 | 1502 | purple_conv_chat_ignore(PurpleConvChat *chat, const char *name) |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1503 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1504 | g_return_if_fail(chat != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1505 | g_return_if_fail(name != NULL); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1506 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1507 | /* Make sure the user isn't already ignored. */ |
| 15884 | 1508 | if (purple_conv_chat_is_user_ignored(chat, name)) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1509 | return; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1510 | |
| 15884 | 1511 | purple_conv_chat_set_ignored(chat, |
|
18187
d560300fa2ab
Re-apply a good change from 2d8ea56b90971e7851442d96b7d74ecb4f052126:
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1512 | g_list_append(chat->ignored, g_strdup(name))); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1513 | } |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1514 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1515 | void |
| 15884 | 1516 | purple_conv_chat_unignore(PurpleConvChat *chat, const char *name) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1517 | { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1518 | GList *item; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1519 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1520 | g_return_if_fail(chat != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1521 | g_return_if_fail(name != NULL); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1522 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1523 | /* Make sure the user is actually ignored. */ |
| 15884 | 1524 | if (!purple_conv_chat_is_user_ignored(chat, name)) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1525 | return; |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1526 | |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1527 | item = g_list_find(purple_conv_chat_get_ignored(chat), |
| 15884 | 1528 | purple_conv_chat_get_ignored_user(chat, name)); |
| 1529 | ||
| 1530 | purple_conv_chat_set_ignored(chat, | |
|
18187
d560300fa2ab
Re-apply a good change from 2d8ea56b90971e7851442d96b7d74ecb4f052126:
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
1531 | g_list_remove_link(chat->ignored, item)); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1532 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1533 | g_free(item->data); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1534 | g_list_free_1(item); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1535 | } |
|
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1536 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1537 | GList * |
| 15884 | 1538 | purple_conv_chat_set_ignored(PurpleConvChat *chat, GList *ignored) |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1539 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1540 | g_return_val_if_fail(chat != NULL, NULL); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1541 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1542 | chat->ignored = ignored; |
|
993
8798e0ac047d
[gaim-migrate @ 1003]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
980
diff
changeset
|
1543 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1544 | return ignored; |
|
2111
34615a640c59
[gaim-migrate @ 2121]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2109
diff
changeset
|
1545 | } |
|
34615a640c59
[gaim-migrate @ 2121]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2109
diff
changeset
|
1546 | |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1547 | GList * |
| 15884 | 1548 | purple_conv_chat_get_ignored(const PurpleConvChat *chat) |
|
2111
34615a640c59
[gaim-migrate @ 2121]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2109
diff
changeset
|
1549 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1550 | g_return_val_if_fail(chat != NULL, NULL); |
|
1898
695a31e4452b
[gaim-migrate @ 1908]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1889
diff
changeset
|
1551 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1552 | return chat->ignored; |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1553 | } |
|
472
9a5b8da2d760
[gaim-migrate @ 482]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
411
diff
changeset
|
1554 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1555 | const char * |
| 15884 | 1556 | purple_conv_chat_get_ignored_user(const PurpleConvChat *chat, const char *user) |
| 1340 | 1557 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1558 | GList *ignored; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1559 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1560 | g_return_val_if_fail(chat != NULL, NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1561 | g_return_val_if_fail(user != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1562 | |
| 15884 | 1563 | for (ignored = purple_conv_chat_get_ignored(chat); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1564 | ignored != NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1565 | ignored = ignored->next) { |
|
2372
c24942700dfd
[gaim-migrate @ 2385]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2363
diff
changeset
|
1566 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1567 | const char *ign = (const char *)ignored->data; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1568 | |
| 15884 | 1569 | if (!purple_utf8_strcasecmp(user, ign) || |
| 1570 | ((*ign == '+' || *ign == '%') && !purple_utf8_strcasecmp(user, ign + 1))) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1571 | return ign; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1572 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1573 | if (*ign == '@') { |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1574 | ign++; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1575 | |
| 15884 | 1576 | if ((*ign == '+' && !purple_utf8_strcasecmp(user, ign + 1)) || |
| 1577 | (*ign != '+' && !purple_utf8_strcasecmp(user, ign))) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1578 | return ign; |
| 3671 | 1579 | } |
| 2094 | 1580 | } |
| 1341 | 1581 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1582 | return NULL; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1583 | } |
| 1341 | 1584 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1585 | gboolean |
| 15884 | 1586 | purple_conv_chat_is_user_ignored(const PurpleConvChat *chat, const char *user) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1587 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1588 | g_return_val_if_fail(chat != NULL, FALSE); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1589 | g_return_val_if_fail(user != NULL, FALSE); |
| 1341 | 1590 | |
| 15884 | 1591 | return (purple_conv_chat_get_ignored_user(chat, user) != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1592 | } |
| 1343 | 1593 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1594 | void |
| 15884 | 1595 | purple_conv_chat_set_topic(PurpleConvChat *chat, const char *who, const char *topic) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1596 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1597 | g_return_if_fail(chat != NULL); |
| 1343 | 1598 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1599 | g_free(chat->who); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1600 | g_free(chat->topic); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1601 | |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1602 | chat->who = g_strdup(who); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1603 | chat->topic = g_strdup(topic); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1604 | |
| 15884 | 1605 | purple_conversation_update(purple_conv_chat_get_conversation(chat), |
| 1606 | PURPLE_CONV_UPDATE_TOPIC); | |
| 1607 | ||
| 1608 | purple_signal_emit(purple_conversations_get_handle(), "chat-topic-changed", | |
| 9517 | 1609 | chat->conv, chat->who, chat->topic); |
| 1340 | 1610 | } |
| 1611 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1612 | const char * |
| 15884 | 1613 | purple_conv_chat_get_topic(const PurpleConvChat *chat) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1614 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1615 | g_return_val_if_fail(chat != NULL, NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1616 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1617 | return chat->topic; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1618 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1619 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1620 | void |
| 15884 | 1621 | purple_conv_chat_set_id(PurpleConvChat *chat, int id) |
|
1573
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1622 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1623 | g_return_if_fail(chat != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1624 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1625 | chat->id = id; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1626 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1627 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1628 | int |
| 15884 | 1629 | purple_conv_chat_get_id(const PurpleConvChat *chat) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1630 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1631 | g_return_val_if_fail(chat != NULL, -1); |
| 3951 | 1632 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1633 | return chat->id; |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1634 | } |
| 3951 | 1635 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1636 | void |
| 15884 | 1637 | purple_conv_chat_write(PurpleConvChat *chat, const char *who, const char *message, |
| 1638 | PurpleMessageFlags flags, time_t mtime) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1639 | { |
| 15884 | 1640 | PurpleAccount *account; |
| 1641 | PurpleConversation *conv; | |
| 1642 | PurpleConnection *gc; | |
| 3866 | 1643 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1644 | g_return_if_fail(chat != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1645 | g_return_if_fail(who != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1646 | g_return_if_fail(message != NULL); |
| 3866 | 1647 | |
| 15884 | 1648 | conv = purple_conv_chat_get_conversation(chat); |
| 1649 | gc = purple_conversation_get_gc(conv); | |
| 1650 | account = purple_connection_get_account(gc); | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1651 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1652 | /* Don't display this if the person who wrote it is ignored. */ |
| 15884 | 1653 | if (purple_conv_chat_is_user_ignored(chat, who)) |
|
1573
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1654 | return; |
| 3677 | 1655 | |
| 15884 | 1656 | if (!(flags & PURPLE_MESSAGE_WHISPER)) { |
|
25721
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25716
diff
changeset
|
1657 | const char *str; |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25716
diff
changeset
|
1658 | |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25716
diff
changeset
|
1659 | str = purple_normalize(account, who); |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25716
diff
changeset
|
1660 | |
|
26889
4de21edc9dc7
Chat's nick is normalized. So normalize before comparing with it.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26762
diff
changeset
|
1661 | if (purple_strequal(str, chat->nick)) { |
| 15884 | 1662 | flags |= PURPLE_MESSAGE_SEND; |
| 8158 | 1663 | } else { |
| 15884 | 1664 | flags |= PURPLE_MESSAGE_RECV; |
| 1665 | ||
| 1666 | if (purple_utf8_has_word(message, chat->nick)) | |
| 1667 | flags |= PURPLE_MESSAGE_NICK; | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1668 | } |
| 3677 | 1669 | } |
| 3705 | 1670 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1671 | /* Pass this on to either the ops structure or the default write func. */ |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1672 | if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL) |
|
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4425
diff
changeset
|
1673 | conv->ui_ops->write_chat(conv, who, message, flags, mtime); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1674 | else |
| 15884 | 1675 | purple_conversation_write(conv, who, message, flags, mtime); |
|
1573
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1676 | } |
|
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1677 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1678 | void |
| 15884 | 1679 | purple_conv_chat_send(PurpleConvChat *chat, const char *message) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1680 | { |
| 15884 | 1681 | purple_conv_chat_send_with_flags(chat, message, 0); |
|
11921
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1682 | } |
|
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1683 | |
|
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1684 | void |
| 15884 | 1685 | purple_conv_chat_send_with_flags(PurpleConvChat *chat, const char *message, PurpleMessageFlags flags) |
|
11921
fe74264ce36c
[gaim-migrate @ 14212]
Evan Schoenberg <evands@pidgin.im>
parents:
11869
diff
changeset
|
1686 | { |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1687 | g_return_if_fail(chat != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1688 | g_return_if_fail(message != NULL); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1689 | |
| 15884 | 1690 | common_send(purple_conv_chat_get_conversation(chat), message, flags); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1691 | } |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1692 | |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1693 | void |
| 15884 | 1694 | purple_conv_chat_add_user(PurpleConvChat *chat, const char *user, |
| 1695 | const char *extra_msg, PurpleConvChatBuddyFlags flags, | |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1696 | gboolean new_arrival) |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1697 | { |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1698 | GList *users = g_list_append(NULL, (char *)user); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1699 | GList *extra_msgs = g_list_append(NULL, (char *)extra_msg); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1700 | GList *flags2 = g_list_append(NULL, GINT_TO_POINTER(flags)); |
| 11581 | 1701 | |
| 15884 | 1702 | purple_conv_chat_add_users(chat, users, extra_msgs, flags2, new_arrival); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1703 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1704 | g_list_free(users); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1705 | g_list_free(extra_msgs); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1706 | g_list_free(flags2); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1707 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1708 | |
|
14043
3b7f131dbb20
[gaim-migrate @ 16548]
Mark Doliner <markdoliner@pidgin.im>
parents:
14031
diff
changeset
|
1709 | static int |
| 15884 | 1710 | purple_conv_chat_cb_compare(PurpleConvChatBuddy *a, PurpleConvChatBuddy *b) |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1711 | { |
| 15884 | 1712 | PurpleConvChatBuddyFlags f1 = 0, f2 = 0; |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1713 | char *user1 = NULL, *user2 = NULL; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1714 | gint ret = 0; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1715 | |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1716 | if (a) { |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1717 | f1 = a->flags; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1718 | if (a->alias_key) |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1719 | user1 = a->alias_key; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1720 | else if (a->name) |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1721 | user1 = a->name; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1722 | } |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1723 | |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1724 | if (b) { |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1725 | f2 = b->flags; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1726 | if (b->alias_key) |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1727 | user2 = b->alias_key; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1728 | else if (b->name) |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1729 | user2 = b->name; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1730 | } |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1731 | |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1732 | if (user1 == NULL || user2 == NULL) { |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1733 | if (!(user1 == NULL && user2 == NULL)) |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1734 | ret = (user1 == NULL) ? -1: 1; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1735 | } else if (f1 != f2) { |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1736 | /* sort more important users first */ |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1737 | ret = (f1 > f2) ? -1 : 1; |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1738 | } else if (a->buddy != b->buddy) { |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1739 | ret = a->buddy ? -1 : 1; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1740 | } else { |
|
17155
143ff2796376
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@pidgin.im>
parents:
17106
diff
changeset
|
1741 | ret = purple_utf8_strcasecmp(user1, user2); |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1742 | } |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1743 | |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1744 | return ret; |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1745 | } |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1746 | |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1747 | void |
| 15884 | 1748 | purple_conv_chat_add_users(PurpleConvChat *chat, GList *users, GList *extra_msgs, |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1749 | GList *flags, gboolean new_arrivals) |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1750 | { |
| 15884 | 1751 | PurpleConversation *conv; |
| 1752 | PurpleConversationUiOps *ops; | |
| 1753 | PurpleConvChatBuddy *cbuddy; | |
| 1754 | PurpleConnection *gc; | |
| 1755 | PurplePluginProtocolInfo *prpl_info; | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1756 | GList *ul, *fl; |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1757 | GList *cbuddies = NULL; |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1758 | |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1759 | g_return_if_fail(chat != NULL); |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1760 | g_return_if_fail(users != NULL); |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1761 | |
| 15884 | 1762 | conv = purple_conv_chat_get_conversation(chat); |
| 1763 | ops = purple_conversation_get_ui_ops(conv); | |
| 1764 | ||
| 1765 | gc = purple_conversation_get_gc(conv); | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1766 | g_return_if_fail(gc != NULL); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22170
diff
changeset
|
1767 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1768 | g_return_if_fail(prpl_info != NULL); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1769 | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1770 | ul = users; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1771 | fl = flags; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1772 | while ((ul != NULL) && (fl != NULL)) { |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1773 | const char *user = (const char *)ul->data; |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1774 | const char *alias = user; |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1775 | gboolean quiet; |
| 15884 | 1776 | PurpleConvChatBuddyFlags flag = GPOINTER_TO_INT(fl->data); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1777 | const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1778 | |
|
17567
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1779 | if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24955
diff
changeset
|
1780 | if (purple_strequal(chat->nick, purple_normalize(conv->account, user))) { |
|
17567
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1781 | const char *alias2 = purple_account_get_alias(conv->account); |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1782 | if (alias2 != NULL) |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1783 | alias = alias2; |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1784 | else |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1785 | { |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1786 | const char *display_name = purple_connection_get_display_name(gc); |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1787 | if (display_name != NULL) |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1788 | alias = display_name; |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1789 | } |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1790 | } else { |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1791 | PurpleBuddy *buddy; |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1792 | if ((buddy = purple_find_buddy(gc->account, user)) != NULL) |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1793 | alias = purple_buddy_get_contact_alias(buddy); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1794 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1795 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1796 | |
| 15884 | 1797 | quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
23558
a83aa53014d5
This should be a boolean or, not a bitwise or.
Will Thompson <resiak@pidgin.im>
parents:
23440
diff
changeset
|
1798 | "chat-buddy-joining", conv, user, flag)) || |
| 15884 | 1799 | purple_conv_chat_is_user_ignored(chat, user); |
| 1800 | ||
| 1801 | cbuddy = purple_conv_chat_cb_new(user, alias, flag); | |
|
18360
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
1802 | cbuddy->buddy = purple_find_buddy(conv->account, user) != NULL; |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1803 | |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1804 | chat->in_room = g_list_prepend(chat->in_room, cbuddy); |
|
31905
1a27482becf4
conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <darkrain42@pidgin.im>
parents:
31903
diff
changeset
|
1805 | g_hash_table_replace(chat->users, g_strdup(cbuddy->name), cbuddy); |
|
14031
c9283f5bf3da
[gaim-migrate @ 16527]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14027
diff
changeset
|
1806 | |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1807 | cbuddies = g_list_prepend(cbuddies, cbuddy); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1808 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1809 | if (!quiet && new_arrivals) { |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1810 | char *alias_esc = g_markup_escape_text(alias, -1); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1811 | char *tmp; |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1812 | |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1813 | if (extra_msg == NULL) |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1814 | tmp = g_strdup_printf(_("%s entered the room."), alias_esc); |
|
12840
548fd34f1f87
[gaim-migrate @ 15188]
Richard Laager <rlaager@pidgin.im>
parents:
12797
diff
changeset
|
1815 | else { |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1816 | char *extra_msg_esc = g_markup_escape_text(extra_msg, -1); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1817 | tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."), |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1818 | alias_esc, extra_msg_esc); |
|
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1819 | g_free(extra_msg_esc); |
|
12840
548fd34f1f87
[gaim-migrate @ 15188]
Richard Laager <rlaager@pidgin.im>
parents:
12797
diff
changeset
|
1820 | } |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
1821 | g_free(alias_esc); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1822 | |
|
18088
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
1823 | purple_conversation_write(conv, NULL, tmp, |
|
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
1824 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
|
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
1825 | time(NULL)); |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1826 | g_free(tmp); |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1827 | } |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1828 | |
| 15884 | 1829 | purple_signal_emit(purple_conversations_get_handle(), |
|
14031
c9283f5bf3da
[gaim-migrate @ 16527]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14027
diff
changeset
|
1830 | "chat-buddy-joined", conv, user, flag, new_arrivals); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1831 | ul = ul->next; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1832 | fl = fl->next; |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1833 | if (extra_msgs != NULL) |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1834 | extra_msgs = extra_msgs->next; |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1835 | } |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1836 | |
| 15884 | 1837 | cbuddies = g_list_sort(cbuddies, (GCompareFunc)purple_conv_chat_cb_compare); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
1838 | |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1839 | if (ops != NULL && ops->chat_add_users != NULL) |
|
14027
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1840 | ops->chat_add_users(conv, cbuddies, new_arrivals); |
|
708c2047424f
[gaim-migrate @ 16521]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
13985
diff
changeset
|
1841 | |
|
14031
c9283f5bf3da
[gaim-migrate @ 16527]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14027
diff
changeset
|
1842 | g_list_free(cbuddies); |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1843 | } |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1844 | |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1845 | void |
| 15884 | 1846 | purple_conv_chat_rename_user(PurpleConvChat *chat, const char *old_user, |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1847 | const char *new_user) |
|
472
9a5b8da2d760
[gaim-migrate @ 482]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
411
diff
changeset
|
1848 | { |
| 15884 | 1849 | PurpleConversation *conv; |
| 1850 | PurpleConversationUiOps *ops; | |
| 1851 | PurpleConnection *gc; | |
| 1852 | PurplePluginProtocolInfo *prpl_info; | |
| 1853 | PurpleConvChatBuddy *cb; | |
| 1854 | PurpleConvChatBuddyFlags flags; | |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1855 | const char *new_alias = new_user; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1856 | char tmp[BUF_LONG]; |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1857 | gboolean is_me = FALSE; |
| 3866 | 1858 | |
|
5677
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1859 | g_return_if_fail(chat != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1860 | g_return_if_fail(old_user != NULL); |
|
2cce4c8654e9
[gaim-migrate @ 6095]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
1861 | g_return_if_fail(new_user != NULL); |
|
960
c4012584334f
[gaim-migrate @ 970]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
936
diff
changeset
|
1862 | |
| 15884 | 1863 | conv = purple_conv_chat_get_conversation(chat); |
| 1864 | ops = purple_conversation_get_ui_ops(conv); | |
| 1865 | ||
| 1866 | gc = purple_conversation_get_gc(conv); | |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1867 | g_return_if_fail(gc != NULL); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22170
diff
changeset
|
1868 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1869 | g_return_if_fail(prpl_info != NULL); |
|
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1870 | |
|
25859
b42be7bb9dac
Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents:
24955
diff
changeset
|
1871 | if (purple_strequal(chat->nick, purple_normalize(conv->account, old_user))) { |
|
11500
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1872 | const char *alias; |
|
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1873 | |
|
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1874 | /* Note this for later. */ |
|
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1875 | is_me = TRUE; |
|
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1876 | |
|
17567
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1877 | if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1878 | alias = purple_account_get_alias(conv->account); |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1879 | if (alias != NULL) |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1880 | new_alias = alias; |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1881 | else |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1882 | { |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1883 | const char *display_name = purple_connection_get_display_name(gc); |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1884 | if (display_name != NULL) |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1885 | alias = display_name; |
|
332ee8ac7662
don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents:
17525
diff
changeset
|
1886 | } |
|
11500
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1887 | } |
|
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1888 | } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
| 15884 | 1889 | PurpleBuddy *buddy; |
| 1890 | if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL) | |
| 1891 | new_alias = purple_buddy_get_contact_alias(buddy); | |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1892 | } |
|
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1893 | |
|
18360
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
1894 | flags = purple_conv_chat_user_get_flags(chat, old_user); |
|
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
1895 | cb = purple_conv_chat_cb_new(new_user, new_alias, flags); |
|
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
1896 | cb->buddy = purple_find_buddy(conv->account, new_user) != NULL; |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1897 | |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1898 | chat->in_room = g_list_prepend(chat->in_room, cb); |
|
31905
1a27482becf4
conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <darkrain42@pidgin.im>
parents:
31903
diff
changeset
|
1899 | g_hash_table_replace(chat->users, g_strdup(cb->name), cb); |
|
18360
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
1900 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1901 | if (ops != NULL && ops->chat_rename_user != NULL) |
|
11485
fe334b13d1d0
[gaim-migrate @ 13727]
Peter Lawler <pidgin@bleeter.id.au>
parents:
11481
diff
changeset
|
1902 | ops->chat_rename_user(conv, old_user, new_user, new_alias); |
| 3671 | 1903 | |
| 15884 | 1904 | cb = purple_conv_chat_cb_find(chat, old_user); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1905 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1906 | if (cb) { |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1907 | chat->in_room = g_list_remove(chat->in_room, cb); |
|
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
1908 | g_hash_table_remove(chat->users, cb->name); |
| 15884 | 1909 | purple_conv_chat_cb_destroy(cb); |
|
4506
e4ef1834b415
[gaim-migrate @ 4781]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
1910 | } |
|
1428
c14bab2b74bb
[gaim-migrate @ 1438]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1414
diff
changeset
|
1911 | |
| 15884 | 1912 | if (purple_conv_chat_is_user_ignored(chat, old_user)) { |
| 1913 | purple_conv_chat_unignore(chat, old_user); | |
| 1914 | purple_conv_chat_ignore(chat, new_user); | |
|
1428
c14bab2b74bb
[gaim-migrate @ 1438]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1414
diff
changeset
|
1915 | } |
| 15884 | 1916 | else if (purple_conv_chat_is_user_ignored(chat, new_user)) |
| 1917 | purple_conv_chat_unignore(chat, new_user); | |
|
1573
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1918 | |
|
11500
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1919 | if (is_me) |
| 15884 | 1920 | purple_conv_chat_set_nick(chat, new_user); |
| 1921 | ||
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
1922 | if (purple_prefs_get_bool("/purple/conversations/chat/show_nick_change") && |
| 15884 | 1923 | !purple_conv_chat_is_user_ignored(chat, new_user)) { |
|
11481
498f90760488
[gaim-migrate @ 13723]
Richard Laager <rlaager@pidgin.im>
parents:
11478
diff
changeset
|
1924 | |
|
11500
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
1925 | if (is_me) { |
|
12853
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1926 | char *escaped = g_markup_escape_text(new_user, -1); |
| 8158 | 1927 | g_snprintf(tmp, sizeof(tmp), |
|
12853
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1928 | _("You are now known as %s"), escaped); |
|
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1929 | g_free(escaped); |
| 8158 | 1930 | } else { |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1931 | const char *old_alias = old_user; |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1932 | const char *new_alias = new_user; |
|
12853
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1933 | char *escaped; |
|
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1934 | char *escaped2; |
| 11581 | 1935 | |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1936 | if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
| 15884 | 1937 | PurpleBuddy *buddy; |
| 1938 | ||
| 1939 | if ((buddy = purple_find_buddy(gc->account, old_user)) != NULL) | |
| 1940 | old_alias = purple_buddy_get_contact_alias(buddy); | |
| 1941 | if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL) | |
| 1942 | new_alias = purple_buddy_get_contact_alias(buddy); | |
|
11454
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1943 | } |
|
a604c2097a6e
[gaim-migrate @ 13693]
Richard Laager <rlaager@pidgin.im>
parents:
11338
diff
changeset
|
1944 | |
|
12853
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1945 | escaped = g_markup_escape_text(old_alias, -1); |
|
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1946 | escaped2 = g_markup_escape_text(new_alias, -1); |
| 8158 | 1947 | g_snprintf(tmp, sizeof(tmp), |
|
12853
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1948 | _("%s is now known as %s"), escaped, escaped2); |
|
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1949 | g_free(escaped); |
|
4afa7cfd2741
[gaim-migrate @ 15203]
Richard Laager <rlaager@pidgin.im>
parents:
12850
diff
changeset
|
1950 | g_free(escaped2); |
| 8158 | 1951 | } |
|
1573
878f7c59ee85
[gaim-migrate @ 1583]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1532
diff
changeset
|
1952 | |
| 18090 | 1953 | purple_conversation_write(conv, NULL, tmp, |
| 1954 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, | |
| 1955 | time(NULL)); | |
|
2843
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2834
diff
changeset
|
1956 | } |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2834
diff
changeset
|
1957 | } |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2834
diff
changeset
|
1958 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
1959 | void |
| 15884 | 1960 | purple_conv_chat_remove_user(PurpleConvChat *chat, const char *user, const char *reason) |
|
2843
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2834
diff
changeset
|
1961 | { |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1962 | GList *users = g_list_append(NULL, (char *)user); |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1963 | |
| 15884 | 1964 | purple_conv_chat_remove_users(chat, users, reason); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1965 | |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1966 | g_list_free(users); |
|
1759
e5987be557ab
[gaim-migrate @ 1769]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1757
diff
changeset
|
1967 | } |
|
2191
a40e37f5bf27
[gaim-migrate @ 2201]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2167
diff
changeset
|
1968 | |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1969 | void |
| 15884 | 1970 | purple_conv_chat_remove_users(PurpleConvChat *chat, GList *users, const char *reason) |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1971 | { |
| 15884 | 1972 | PurpleConversation *conv; |
| 1973 | PurpleConnection *gc; | |
| 1974 | PurplePluginProtocolInfo *prpl_info; | |
| 1975 | PurpleConversationUiOps *ops; | |
| 1976 | PurpleConvChatBuddy *cb; | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1977 | GList *l; |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1978 | gboolean quiet; |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1979 | |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1980 | g_return_if_fail(chat != NULL); |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1981 | g_return_if_fail(users != NULL); |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1982 | |
| 15884 | 1983 | conv = purple_conv_chat_get_conversation(chat); |
| 1984 | ||
| 1985 | gc = purple_conversation_get_gc(conv); | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1986 | g_return_if_fail(gc != NULL); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22170
diff
changeset
|
1987 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1988 | g_return_if_fail(prpl_info != NULL); |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1989 | |
| 15884 | 1990 | ops = purple_conversation_get_ui_ops(conv); |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1991 | |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1992 | for (l = users; l != NULL; l = l->next) { |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
1993 | const char *user = (const char *)l->data; |
| 15884 | 1994 | quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
1995 | "chat-buddy-leaving", conv, user, reason)) | |
| 15884 | 1996 | purple_conv_chat_is_user_ignored(chat, user); |
| 1997 | ||
| 1998 | cb = purple_conv_chat_cb_find(chat, user); | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
1999 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2000 | if (cb) { |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
2001 | chat->in_room = g_list_remove(chat->in_room, cb); |
|
31908
f21c53266e55
conversation: Okay, one final fix.
Paul Aurich <darkrain42@pidgin.im>
parents:
31906
diff
changeset
|
2002 | g_hash_table_remove(chat->users, cb->name); |
| 15884 | 2003 | purple_conv_chat_cb_destroy(cb); |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
2004 | } |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2005 | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2006 | /* NOTE: Don't remove them from ignored in case they re-enter. */ |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
2007 | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2008 | if (!quiet) { |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2009 | const char *alias = user; |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2010 | char *alias_esc; |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2011 | char *tmp; |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2012 | |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2013 | if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
| 15884 | 2014 | PurpleBuddy *buddy; |
| 2015 | ||
| 2016 | if ((buddy = purple_find_buddy(gc->account, user)) != NULL) | |
| 2017 | alias = purple_buddy_get_contact_alias(buddy); | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2018 | } |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2019 | |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2020 | alias_esc = g_markup_escape_text(alias, -1); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2021 | |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2022 | if (reason == NULL || !*reason) |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2023 | tmp = g_strdup_printf(_("%s left the room."), alias_esc); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2024 | else { |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2025 | char *reason_esc = g_markup_escape_text(reason, -1); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2026 | tmp = g_strdup_printf(_("%s left the room (%s)."), |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2027 | alias_esc, reason_esc); |
|
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2028 | g_free(reason_esc); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2029 | } |
|
23559
e7847951a0c6
Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <resiak@pidgin.im>
parents:
23558
diff
changeset
|
2030 | g_free(alias_esc); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2031 | |
|
18088
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
2032 | purple_conversation_write(conv, NULL, tmp, |
|
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
2033 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
|
2e08852cc6c5
use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents:
18087
diff
changeset
|
2034 | time(NULL)); |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2035 | g_free(tmp); |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2036 | } |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2037 | |
| 15884 | 2038 | purple_signal_emit(purple_conversations_get_handle(), "chat-buddy-left", |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2039 | conv, user, reason); |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
2040 | } |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
2041 | |
|
12867
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2042 | if (ops != NULL && ops->chat_remove_users != NULL) |
|
080393331813
[gaim-migrate @ 15218]
Andrea Canciani <ranma42@users.sourceforge.net>
parents:
12853
diff
changeset
|
2043 | ops->chat_remove_users(conv, users); |
|
6407
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
2044 | } |
|
d67b6a6ba7d2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
2045 | |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2046 | void |
| 15884 | 2047 | purple_conv_chat_clear_users(PurpleConvChat *chat) |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2048 | { |
| 15884 | 2049 | PurpleConversation *conv; |
| 2050 | PurpleConversationUiOps *ops; | |
|
18187
d560300fa2ab
Re-apply a good change from 2d8ea56b90971e7851442d96b7d74ecb4f052126:
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
2051 | GList *users; |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2052 | GList *l; |
|
18187
d560300fa2ab
Re-apply a good change from 2d8ea56b90971e7851442d96b7d74ecb4f052126:
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
2053 | GList *names = NULL; |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2054 | |
|
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2055 | g_return_if_fail(chat != NULL); |
|
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2056 | |
| 15884 | 2057 | conv = purple_conv_chat_get_conversation(chat); |
| 2058 | ops = purple_conversation_get_ui_ops(conv); | |
|
18187
d560300fa2ab
Re-apply a good change from 2d8ea56b90971e7851442d96b7d74ecb4f052126:
Richard Laager <rlaager@pidgin.im>
parents:
18122
diff
changeset
|
2059 | users = chat->in_room; |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2060 | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2061 | if (ops != NULL && ops->chat_remove_users != NULL) { |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2062 | for (l = users; l; l = l->next) { |
| 15884 | 2063 | PurpleConvChatBuddy *cb = l->data; |
|
17621
2c27d0e86859
In purple_conv_chat_clear_users(), use g_list_prepend() instead of
Richard Laager <rlaager@pidgin.im>
parents:
17567
diff
changeset
|
2064 | names = g_list_prepend(names, cb->name); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2065 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2066 | ops->chat_remove_users(conv, names); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2067 | g_list_free(names); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2068 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2069 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2070 | for (l = users; l; l = l->next) |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2071 | { |
| 15884 | 2072 | PurpleConvChatBuddy *cb = l->data; |
| 2073 | ||
| 2074 | purple_signal_emit(purple_conversations_get_handle(), | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2075 | "chat-buddy-leaving", conv, cb->name, NULL); |
| 15884 | 2076 | purple_signal_emit(purple_conversations_get_handle(), |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2077 | "chat-buddy-left", conv, cb->name, NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2078 | |
| 15884 | 2079 | purple_conv_chat_cb_destroy(cb); |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2080 | } |
|
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2081 | |
|
31905
1a27482becf4
conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <darkrain42@pidgin.im>
parents:
31903
diff
changeset
|
2082 | g_hash_table_remove_all(chat->users); |
|
1a27482becf4
conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <darkrain42@pidgin.im>
parents:
31903
diff
changeset
|
2083 | |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2084 | g_list_free(users); |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
2085 | chat->in_room = NULL; |
|
6414
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2086 | } |
|
f78eb072fcc0
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
2087 | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2088 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2089 | gboolean |
| 15884 | 2090 | purple_conv_chat_find_user(PurpleConvChat *chat, const char *user) |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2091 | { |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2092 | g_return_val_if_fail(chat != NULL, FALSE); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2093 | g_return_val_if_fail(user != NULL, FALSE); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2094 | |
| 15884 | 2095 | return (purple_conv_chat_cb_find(chat, user) != NULL); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2096 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2097 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2098 | void |
| 15884 | 2099 | purple_conv_chat_user_set_flags(PurpleConvChat *chat, const char *user, |
| 2100 | PurpleConvChatBuddyFlags flags) | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2101 | { |
| 15884 | 2102 | PurpleConversation *conv; |
| 2103 | PurpleConversationUiOps *ops; | |
| 2104 | PurpleConvChatBuddy *cb; | |
| 2105 | PurpleConvChatBuddyFlags oldflags; | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2106 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2107 | g_return_if_fail(chat != NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2108 | g_return_if_fail(user != NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2109 | |
| 15884 | 2110 | cb = purple_conv_chat_cb_find(chat, user); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2111 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2112 | if (!cb) |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2113 | return; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2114 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2115 | if (flags == cb->flags) |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2116 | return; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2117 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2118 | oldflags = cb->flags; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2119 | cb->flags = flags; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2120 | |
| 15884 | 2121 | conv = purple_conv_chat_get_conversation(chat); |
| 2122 | ops = purple_conversation_get_ui_ops(conv); | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2123 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2124 | if (ops != NULL && ops->chat_update_user != NULL) |
|
11500
e0965fb5bcd8
[gaim-migrate @ 13745]
Richard Laager <rlaager@pidgin.im>
parents:
11485
diff
changeset
|
2125 | ops->chat_update_user(conv, user); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2126 | |
| 15884 | 2127 | purple_signal_emit(purple_conversations_get_handle(), |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2128 | "chat-buddy-flags", conv, user, oldflags, flags); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2129 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2130 | |
| 15884 | 2131 | PurpleConvChatBuddyFlags |
| 2132 | purple_conv_chat_user_get_flags(PurpleConvChat *chat, const char *user) | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2133 | { |
| 15884 | 2134 | PurpleConvChatBuddy *cb; |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2135 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2136 | g_return_val_if_fail(chat != NULL, 0); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2137 | g_return_val_if_fail(user != NULL, 0); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2138 | |
| 15884 | 2139 | cb = purple_conv_chat_cb_find(chat, user); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2140 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2141 | if (!cb) |
| 15884 | 2142 | return PURPLE_CBFLAGS_NONE; |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2143 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2144 | return cb->flags; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2145 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2146 | |
| 15884 | 2147 | void purple_conv_chat_set_nick(PurpleConvChat *chat, const char *nick) { |
| 8158 | 2148 | g_return_if_fail(chat != NULL); |
| 2149 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
2150 | g_free(chat->nick); |
| 15884 | 2151 | chat->nick = g_strdup(purple_normalize(chat->conv->account, nick)); |
| 8158 | 2152 | } |
| 2153 | ||
| 15884 | 2154 | const char *purple_conv_chat_get_nick(PurpleConvChat *chat) { |
| 8158 | 2155 | g_return_val_if_fail(chat != NULL, NULL); |
| 2156 | ||
| 2157 | return chat->nick; | |
| 2158 | } | |
| 2159 | ||
| 15884 | 2160 | PurpleConversation * |
| 2161 | purple_find_chat(const PurpleConnection *gc, int id) | |
|
2191
a40e37f5bf27
[gaim-migrate @ 2201]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2167
diff
changeset
|
2162 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2163 | GList *l; |
| 15884 | 2164 | PurpleConversation *conv; |
| 2165 | ||
| 2166 | for (l = purple_get_chats(); l != NULL; l = l->next) { | |
| 2167 | conv = (PurpleConversation *)l->data; | |
| 2168 | ||
| 2169 | if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)) == id && | |
| 2170 | purple_conversation_get_gc(conv) == gc) | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2171 | return conv; |
|
2499
0e48d0a33bf7
[gaim-migrate @ 2512]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2487
diff
changeset
|
2172 | } |
|
0e48d0a33bf7
[gaim-migrate @ 2512]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2487
diff
changeset
|
2173 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
2174 | return NULL; |
|
2191
a40e37f5bf27
[gaim-migrate @ 2201]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2167
diff
changeset
|
2175 | } |
|
4469
ef60c820b884
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4467
diff
changeset
|
2176 | |
| 8256 | 2177 | void |
| 15884 | 2178 | purple_conv_chat_left(PurpleConvChat *chat) |
| 8256 | 2179 | { |
| 2180 | g_return_if_fail(chat != NULL); | |
| 2181 | ||
| 2182 | chat->left = TRUE; | |
| 15884 | 2183 | purple_conversation_update(chat->conv, PURPLE_CONV_UPDATE_CHATLEFT); |
| 8256 | 2184 | } |
| 2185 | ||
|
26762
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2186 | static void |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2187 | invite_user_to_chat(gpointer data, PurpleRequestFields *fields) |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2188 | { |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2189 | PurpleConversation *conv; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2190 | PurpleConvChat *chat; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2191 | const char *user, *message; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2192 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2193 | conv = data; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2194 | chat = PURPLE_CONV_CHAT(conv); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2195 | user = purple_request_fields_get_string(fields, "screenname"); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2196 | message = purple_request_fields_get_string(fields, "message"); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2197 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2198 | serv_chat_invite(purple_conversation_get_gc(conv), chat->id, message, user); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2199 | } |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2200 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2201 | void purple_conv_chat_invite_user(PurpleConvChat *chat, const char *user, |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2202 | const char *message, gboolean confirm) |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2203 | { |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2204 | PurpleAccount *account; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2205 | PurpleConversation *conv; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2206 | PurpleRequestFields *fields; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2207 | PurpleRequestFieldGroup *group; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2208 | PurpleRequestField *field; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2209 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2210 | g_return_if_fail(chat); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2211 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2212 | if (!user || !*user || !message || !*message) |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2213 | confirm = TRUE; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2214 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2215 | conv = chat->conv; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2216 | account = conv->account; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2217 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2218 | if (!confirm) { |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2219 | serv_chat_invite(purple_account_get_connection(account), |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2220 | purple_conv_chat_get_id(chat), message, user); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2221 | return; |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2222 | } |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2223 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2224 | fields = purple_request_fields_new(); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2225 | group = purple_request_field_group_new(_("Invite to chat")); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2226 | purple_request_fields_add_group(fields, group); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2227 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2228 | field = purple_request_field_string_new("screenname", _("Buddy"), user, FALSE); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2229 | purple_request_field_group_add_field(group, field); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2230 | purple_request_field_set_required(field, TRUE); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2231 | purple_request_field_set_type_hint(field, "screenname"); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2232 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2233 | field = purple_request_field_string_new("message", _("Message"), message, FALSE); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2234 | purple_request_field_group_add_field(group, field); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2235 | |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2236 | purple_request_fields(conv, _("Invite to chat"), NULL, |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2237 | _("Please enter the name of the user you wish to invite, " |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2238 | "along with an optional invite message."), |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2239 | fields, |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2240 | _("Invite"), G_CALLBACK(invite_user_to_chat), |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2241 | _("Cancel"), NULL, |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2242 | account, user, conv, |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2243 | conv); |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2244 | } |
|
8cd83b679338
Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26752
diff
changeset
|
2245 | |
| 8256 | 2246 | gboolean |
| 15884 | 2247 | purple_conv_chat_has_left(PurpleConvChat *chat) |
| 8256 | 2248 | { |
| 2249 | g_return_val_if_fail(chat != NULL, TRUE); | |
| 2250 | ||
| 2251 | return chat->left; | |
| 2252 | } | |
|
18360
24a00376266d
Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18193
diff
changeset
|
2253 | |
| 15884 | 2254 | PurpleConvChatBuddy * |
| 2255 | purple_conv_chat_cb_new(const char *name, const char *alias, PurpleConvChatBuddyFlags flags) | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2256 | { |
| 15884 | 2257 | PurpleConvChatBuddy *cb; |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2258 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2259 | g_return_val_if_fail(name != NULL, NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2260 | |
| 15884 | 2261 | cb = g_new0(PurpleConvChatBuddy, 1); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2262 | cb->name = g_strdup(name); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2263 | cb->flags = flags; |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
2264 | cb->alias = g_strdup(alias); |
|
31397
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2265 | cb->attributes = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2266 | g_free, g_free); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2267 | |
| 15884 | 2268 | PURPLE_DBUS_REGISTER_POINTER(cb, PurpleConvChatBuddy); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2269 | return cb; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2270 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2271 | |
| 15884 | 2272 | PurpleConvChatBuddy * |
| 2273 | purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name) | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2274 | { |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2275 | g_return_val_if_fail(chat != NULL, NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2276 | g_return_val_if_fail(name != NULL, NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2277 | |
|
31900
bd3ee9587add
conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <darkrain42@pidgin.im>
parents:
31643
diff
changeset
|
2278 | return g_hash_table_lookup(chat->users, name); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2279 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2280 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2281 | void |
| 15884 | 2282 | purple_conv_chat_cb_destroy(PurpleConvChatBuddy *cb) |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2283 | { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
2284 | if (cb == NULL) |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14059
diff
changeset
|
2285 | return; |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2286 | |
|
31906
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2287 | purple_signal_emit(purple_conversations_get_handle(), |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2288 | "deleting-chat-buddy", cb); |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2289 | |
|
14059
0acd139472fd
[gaim-migrate @ 16582]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14043
diff
changeset
|
2290 | g_free(cb->alias); |
|
0acd139472fd
[gaim-migrate @ 16582]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14043
diff
changeset
|
2291 | g_free(cb->alias_key); |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
2292 | g_free(cb->name); |
|
31397
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2293 | g_hash_table_destroy(cb->attributes); |
|
11146
c56333373e3c
[gaim-migrate @ 13217]
Piotr Zielinski <zielaj@users.sourceforge.net>
parents:
11137
diff
changeset
|
2294 | |
| 15884 | 2295 | PURPLE_DBUS_UNREGISTER_POINTER(cb); |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2296 | g_free(cb); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2297 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2298 | |
|
32615
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2299 | void purple_conv_chat_cb_set_ui_data(PurpleConvChatBuddy *cb, gpointer ui_data) |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2300 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2301 | g_return_if_fail(cb != NULL); |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2302 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2303 | cb->ui_data = ui_data; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2304 | } |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2305 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2306 | gpointer purple_conv_chat_cb_get_ui_data(const PurpleConvChatBuddy *cb) |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2307 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2308 | g_return_val_if_fail(cb != NULL, NULL); |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2309 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2310 | return cb->ui_data; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2311 | } |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2312 | |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2313 | const char * |
|
32615
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2314 | purple_conv_chat_cb_get_alias(const PurpleConvChatBuddy *cb) |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2315 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2316 | g_return_val_if_fail(cb != NULL, NULL); |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2317 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2318 | return cb->alias; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2319 | } |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2320 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2321 | const char * |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2322 | purple_conv_chat_cb_get_name(const PurpleConvChatBuddy *cb) |
|
9554
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2323 | { |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2324 | g_return_val_if_fail(cb != NULL, NULL); |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2325 | |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2326 | return cb->name; |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2327 | } |
|
1609ba3612c3
[gaim-migrate @ 10387]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9528
diff
changeset
|
2328 | |
|
32615
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2329 | PurpleConvChatBuddyFlags |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2330 | purple_conv_chat_cb_get_flags(const PurpleConvChatBuddy *cb) |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2331 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2332 | g_return_val_if_fail(cb != NULL, PURPLE_CBFLAGS_NONE); |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2333 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2334 | return cb->flags; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2335 | } |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2336 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2337 | gboolean purple_conv_chat_cb_is_buddy(const PurpleConvChatBuddy *cb) |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2338 | { |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2339 | g_return_val_if_fail(cb != NULL, FALSE); |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2340 | |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2341 | return cb->buddy; |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2342 | } |
|
18515e130606
Hide struct _PurpleConvChatBuddy.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
2343 | |
|
31397
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2344 | const char * |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2345 | purple_conv_chat_cb_get_attribute(PurpleConvChatBuddy *cb, const char *key) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2346 | { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2347 | g_return_val_if_fail(cb != NULL, NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2348 | g_return_val_if_fail(key != NULL, NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2349 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2350 | return g_hash_table_lookup(cb->attributes, key); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2351 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2352 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2353 | static void |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2354 | append_attribute_key(gpointer key, gpointer value, gpointer user_data) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2355 | { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2356 | GList **list = user_data; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2357 | *list = g_list_prepend(*list, key); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2358 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2359 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2360 | GList * |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2361 | purple_conv_chat_cb_get_attribute_keys(PurpleConvChatBuddy *cb) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2362 | { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2363 | GList *keys = NULL; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2364 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2365 | g_return_val_if_fail(cb != NULL, NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2366 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2367 | g_hash_table_foreach(cb->attributes, (GHFunc)append_attribute_key, &keys); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2368 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2369 | return keys; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2370 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2371 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2372 | void |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2373 | purple_conv_chat_cb_set_attribute(PurpleConvChat *chat, PurpleConvChatBuddy *cb, const char *key, const char *value) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2374 | { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2375 | PurpleConversation *conv; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2376 | PurpleConversationUiOps *ops; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2377 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2378 | g_return_if_fail(cb != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2379 | g_return_if_fail(key != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2380 | g_return_if_fail(value != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2381 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2382 | g_hash_table_replace(cb->attributes, g_strdup(key), g_strdup(value)); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2383 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2384 | conv = purple_conv_chat_get_conversation(chat); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2385 | ops = purple_conversation_get_ui_ops(conv); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2386 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2387 | if (ops != NULL && ops->chat_update_user != NULL) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2388 | ops->chat_update_user(conv, cb->name); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2389 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2390 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2391 | void |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2392 | purple_conv_chat_cb_set_attributes(PurpleConvChat *chat, PurpleConvChatBuddy *cb, GList *keys, GList *values) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2393 | { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2394 | PurpleConversation *conv; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2395 | PurpleConversationUiOps *ops; |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2396 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2397 | g_return_if_fail(cb != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2398 | g_return_if_fail(keys != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2399 | g_return_if_fail(values != NULL); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2400 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2401 | while (keys != NULL && values != NULL) { |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2402 | g_hash_table_replace(cb->attributes, g_strdup(keys->data), g_strdup(values->data)); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2403 | keys = g_list_next(keys); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2404 | values = g_list_next(values); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2405 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2406 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2407 | conv = purple_conv_chat_get_conversation(chat); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2408 | ops = purple_conversation_get_ui_ops(conv); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2409 | |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2410 | if (ops != NULL && ops->chat_update_user != NULL) |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2411 | ops->chat_update_user(conv, cb->name); |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2412 | } |
|
b50f1cf05a5e
Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evands@pidgin.im>
parents:
31294
diff
changeset
|
2413 | |
|
17265
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2414 | GList * |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2415 | purple_conversation_get_extended_menu(PurpleConversation *conv) |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2416 | { |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2417 | GList *menu = NULL; |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2418 | |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2419 | g_return_val_if_fail(conv != NULL, NULL); |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2420 | |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2421 | purple_signal_emit(purple_conversations_get_handle(), |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2422 | "conversation-extended-menu", conv, &menu); |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2423 | return menu; |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2424 | } |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2425 | |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2426 | void purple_conversation_clear_message_history(PurpleConversation *conv) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2427 | { |
|
19904
8abf4c2056eb
Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
2428 | GList *list = conv->message_history; |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2429 | message_history_free(list); |
|
19904
8abf4c2056eb
Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
2430 | conv->message_history = NULL; |
|
31643
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2431 | |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2432 | purple_signal_emit(purple_conversations_get_handle(), |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2433 | "cleared-message-history", conv); |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2434 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2435 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2436 | GList *purple_conversation_get_message_history(PurpleConversation *conv) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2437 | { |
|
19904
8abf4c2056eb
Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
2438 | return conv->message_history; |
|
19590
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2439 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2440 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2441 | const char *purple_conversation_message_get_sender(PurpleConvMessage *msg) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2442 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2443 | g_return_val_if_fail(msg, NULL); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2444 | return msg->who; |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2445 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2446 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2447 | const char *purple_conversation_message_get_message(PurpleConvMessage *msg) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2448 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2449 | g_return_val_if_fail(msg, NULL); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2450 | return msg->what; |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2451 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2452 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2453 | PurpleMessageFlags purple_conversation_message_get_flags(PurpleConvMessage *msg) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2454 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2455 | g_return_val_if_fail(msg, 0); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2456 | return msg->flags; |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2457 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2458 | |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2459 | time_t purple_conversation_message_get_timestamp(PurpleConvMessage *msg) |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2460 | { |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2461 | g_return_val_if_fail(msg, 0); |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2462 | return msg->when; |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2463 | } |
|
cf4e3e71bbc0
Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19118
diff
changeset
|
2464 | |
|
32253
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2465 | void purple_conversation_set_ui_data(PurpleConversation *conv, gpointer ui_data) |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2466 | { |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2467 | g_return_if_fail(conv != NULL); |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2468 | |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2469 | conv->ui_data = ui_data; |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2470 | } |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2471 | |
|
32256
620e4580252a
These pointers should rather be marked const.
Andrew Victor <andrew.victor@mxit.com>
parents:
32253
diff
changeset
|
2472 | gpointer purple_conversation_get_ui_data(const PurpleConversation *conv) |
|
32253
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2473 | { |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2474 | g_return_val_if_fail(conv != NULL, NULL); |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2475 | |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2476 | return conv->ui_data; |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2477 | } |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2478 | |
|
99ecf637808b
Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
31937
diff
changeset
|
2479 | |
|
17266
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2480 | gboolean |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2481 | purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline, |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2482 | const gchar *markup, gchar **error) |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2483 | { |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2484 | char *mark = (markup && *markup) ? NULL : g_markup_escape_text(cmdline, -1), *err = NULL; |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2485 | PurpleCmdStatus status = purple_cmd_do_command(conv, cmdline, mark ? mark : markup, error ? error : &err); |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2486 | g_free(mark); |
|
17267
f653ad9f7ad9
Plug a possible memory leak.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17266
diff
changeset
|
2487 | g_free(err); |
|
17266
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2488 | return (status == PURPLE_CMD_STATUS_OK); |
|
d4dc6a9ca244
New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17265
diff
changeset
|
2489 | } |
|
17265
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2490 | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2491 | void * |
| 15884 | 2492 | purple_conversations_get_handle(void) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2493 | { |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2494 | static int handle; |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2495 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2496 | return &handle; |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2497 | } |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2498 | |
| 5858 | 2499 | void |
| 15884 | 2500 | purple_conversations_init(void) |
| 5858 | 2501 | { |
| 15884 | 2502 | void *handle = purple_conversations_get_handle(); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2503 | |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
2504 | conversation_cache = g_hash_table_new_full((GHashFunc)_purple_conversations_hconv_hash, |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
2505 | (GEqualFunc)_purple_conversations_hconv_equal, |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
2506 | (GDestroyNotify)_purple_conversations_hconv_free_key, NULL); |
|
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
2507 | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2508 | /********************************************************************** |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2509 | * Register preferences |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2510 | **********************************************************************/ |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2511 | |
| 5858 | 2512 | /* Conversations */ |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
2513 | purple_prefs_add_none("/purple/conversations"); |
| 5858 | 2514 | |
| 2515 | /* Conversations -> Chat */ | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
2516 | purple_prefs_add_none("/purple/conversations/chat"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
2517 | purple_prefs_add_bool("/purple/conversations/chat/show_nick_change", TRUE); |
| 5858 | 2518 | |
| 2519 | /* Conversations -> IM */ | |
|
16478
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
2520 | purple_prefs_add_none("/purple/conversations/im"); |
|
19107605c565
Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@pidgin.im>
parents:
15884
diff
changeset
|
2521 | purple_prefs_add_bool("/purple/conversations/im/send_typing", TRUE); |
| 5858 | 2522 | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2523 | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2524 | /********************************************************************** |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2525 | * Register signals |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6837
diff
changeset
|
2526 | **********************************************************************/ |
| 15884 | 2527 | purple_signal_register(handle, "writing-im-msg", |
|
18744
e6b4c7abe951
Fix up writing-im-msg and writing-chat-msg to use a marshaller which treats the
Will Thompson <resiak@pidgin.im>
parents:
18360
diff
changeset
|
2528 | purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT, |
| 15884 | 2529 | purple_value_new(PURPLE_TYPE_BOOLEAN), 5, |
| 2530 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2531 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2532 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2533 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2534 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2535 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2536 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2537 | ||
| 2538 | purple_signal_register(handle, "wrote-im-msg", | |
| 2539 | purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
2540 | NULL, 5, |
| 15884 | 2541 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2542 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2543 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2544 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2545 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2546 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2547 | purple_value_new(PURPLE_TYPE_UINT)); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30706
diff
changeset
|
2548 | |
|
24457
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2549 | purple_signal_register(handle, "sent-attention", |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2550 | purple_marshal_VOID__POINTER_POINTER_POINTER_UINT, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2551 | NULL, 4, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2552 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2553 | PURPLE_SUBTYPE_ACCOUNT), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2554 | purple_value_new(PURPLE_TYPE_STRING), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2555 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2556 | PURPLE_SUBTYPE_CONVERSATION), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2557 | purple_value_new(PURPLE_TYPE_UINT)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30706
diff
changeset
|
2558 | |
|
24457
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2559 | purple_signal_register(handle, "got-attention", |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2560 | purple_marshal_VOID__POINTER_POINTER_POINTER_UINT, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2561 | NULL, 4, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2562 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2563 | PURPLE_SUBTYPE_ACCOUNT), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2564 | purple_value_new(PURPLE_TYPE_STRING), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2565 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2566 | PURPLE_SUBTYPE_CONVERSATION), |
|
adbbdb0532b0
Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <malu@pidgin.im>
parents:
24051
diff
changeset
|
2567 | purple_value_new(PURPLE_TYPE_UINT)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30706
diff
changeset
|
2568 | |
| 15884 | 2569 | purple_signal_register(handle, "sending-im-msg", |
| 2570 | purple_marshal_VOID__POINTER_POINTER_POINTER, | |
|
6564
a7a2c1927544
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2571 | NULL, 3, |
| 15884 | 2572 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2573 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2574 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2575 | purple_value_new_outgoing(PURPLE_TYPE_STRING)); | |
| 2576 | ||
| 2577 | purple_signal_register(handle, "sent-im-msg", | |
| 2578 | purple_marshal_VOID__POINTER_POINTER_POINTER, | |
|
6564
a7a2c1927544
[gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents:
6509
diff
changeset
|
2579 | NULL, 3, |
| 15884 | 2580 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2581 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2582 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2583 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2584 | ||
| 2585 | purple_signal_register(handle, "receiving-im-msg", | |
| 2586 | purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, | |
| 2587 | purple_value_new(PURPLE_TYPE_BOOLEAN), 5, | |
| 2588 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2589 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2590 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2591 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2592 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2593 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2594 | purple_value_new_outgoing(PURPLE_TYPE_UINT)); | |
| 2595 | ||
| 2596 | purple_signal_register(handle, "received-im-msg", | |
| 2597 | purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, | |
|
10104
081392879815
[gaim-migrate @ 11131]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10087
diff
changeset
|
2598 | NULL, 5, |
| 15884 | 2599 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2600 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2601 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2602 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2603 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2604 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2605 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2606 | ||
|
23312
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2607 | purple_signal_register(handle, "blocked-im-msg", |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2608 | purple_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2609 | NULL, 5, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2610 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2611 | PURPLE_SUBTYPE_ACCOUNT), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2612 | purple_value_new(PURPLE_TYPE_STRING), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2613 | purple_value_new(PURPLE_TYPE_STRING), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2614 | purple_value_new(PURPLE_TYPE_UINT), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2615 | purple_value_new(PURPLE_TYPE_UINT)); |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2616 | |
| 15884 | 2617 | purple_signal_register(handle, "writing-chat-msg", |
|
18744
e6b4c7abe951
Fix up writing-im-msg and writing-chat-msg to use a marshaller which treats the
Will Thompson <resiak@pidgin.im>
parents:
18360
diff
changeset
|
2618 | purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT, |
| 15884 | 2619 | purple_value_new(PURPLE_TYPE_BOOLEAN), 5, |
| 2620 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2621 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2622 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2623 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2624 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2625 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2626 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2627 | ||
| 2628 | purple_signal_register(handle, "wrote-chat-msg", | |
| 2629 | purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, | |
|
13234
1d8e569b2053
[gaim-migrate @ 15598]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13120
diff
changeset
|
2630 | NULL, 5, |
| 15884 | 2631 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2632 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2633 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2634 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2635 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2636 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2637 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2638 | ||
| 2639 | purple_signal_register(handle, "sending-chat-msg", | |
| 2640 | purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, | |
| 2641 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2642 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2643 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2644 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2645 | ||
| 2646 | purple_signal_register(handle, "sent-chat-msg", | |
| 2647 | purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3, | |
| 2648 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2649 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2650 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2651 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2652 | ||
| 2653 | purple_signal_register(handle, "receiving-chat-msg", | |
| 2654 | purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER, | |
| 2655 | purple_value_new(PURPLE_TYPE_BOOLEAN), 5, | |
| 2656 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2657 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2658 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2659 | purple_value_new_outgoing(PURPLE_TYPE_STRING), | |
| 2660 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2661 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2662 | purple_value_new_outgoing(PURPLE_TYPE_UINT)); | |
| 2663 | ||
| 2664 | purple_signal_register(handle, "received-chat-msg", | |
| 2665 | purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, | |
|
10104
081392879815
[gaim-migrate @ 11131]
Nathan Fredrickson <nathan@silverorange.com>
parents:
10087
diff
changeset
|
2666 | NULL, 5, |
| 15884 | 2667 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2668 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2669 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2670 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2671 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2672 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2673 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2674 | ||
| 2675 | purple_signal_register(handle, "conversation-created", | |
| 2676 | purple_marshal_VOID__POINTER, NULL, 1, | |
| 2677 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2678 | PURPLE_SUBTYPE_CONVERSATION)); | |
| 2679 | ||
| 2680 | purple_signal_register(handle, "conversation-updated", | |
| 2681 | purple_marshal_VOID__POINTER_UINT, NULL, 2, | |
| 2682 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2683 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2684 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2685 | ||
| 2686 | purple_signal_register(handle, "deleting-conversation", | |
| 2687 | purple_marshal_VOID__POINTER, NULL, 1, | |
| 2688 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2689 | PURPLE_SUBTYPE_CONVERSATION)); | |
| 2690 | ||
| 2691 | purple_signal_register(handle, "buddy-typing", | |
| 2692 | purple_marshal_VOID__POINTER_POINTER, NULL, 2, | |
| 2693 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2694 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2695 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2696 | ||
| 2697 | purple_signal_register(handle, "buddy-typed", | |
| 2698 | purple_marshal_VOID__POINTER_POINTER, NULL, 2, | |
| 2699 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2700 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2701 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2702 | ||
| 2703 | purple_signal_register(handle, "buddy-typing-stopped", | |
| 2704 | purple_marshal_VOID__POINTER_POINTER, NULL, 2, | |
| 2705 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2706 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2707 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2708 | ||
| 2709 | purple_signal_register(handle, "chat-buddy-joining", | |
| 2710 | purple_marshal_BOOLEAN__POINTER_POINTER_UINT, | |
| 2711 | purple_value_new(PURPLE_TYPE_BOOLEAN), 3, | |
| 2712 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2713 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2714 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2715 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2716 | ||
| 2717 | purple_signal_register(handle, "chat-buddy-joined", | |
| 2718 | purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4, | |
| 2719 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2720 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2721 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2722 | purple_value_new(PURPLE_TYPE_UINT), | |
| 2723 | purple_value_new(PURPLE_TYPE_BOOLEAN)); | |
| 2724 | ||
| 2725 | purple_signal_register(handle, "chat-buddy-flags", | |
| 2726 | purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4, | |
| 2727 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2728 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2729 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2730 | purple_value_new(PURPLE_TYPE_UINT), | |
| 2731 | purple_value_new(PURPLE_TYPE_UINT)); | |
| 2732 | ||
| 2733 | purple_signal_register(handle, "chat-buddy-leaving", | |
| 2734 | purple_marshal_BOOLEAN__POINTER_POINTER_POINTER, | |
| 2735 | purple_value_new(PURPLE_TYPE_BOOLEAN), 3, | |
| 2736 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2737 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2738 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2739 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2740 | ||
| 2741 | purple_signal_register(handle, "chat-buddy-left", | |
| 2742 | purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, | |
| 2743 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2744 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2745 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2746 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2747 | ||
|
31906
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2748 | purple_signal_register(handle, "deleting-chat-buddy", |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2749 | purple_marshal_VOID__POINTER, NULL, 1, |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2750 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2751 | PURPLE_SUBTYPE_CHATBUDDY)); |
|
d1ffe4b1de91
Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents:
31905
diff
changeset
|
2752 | |
| 15884 | 2753 | purple_signal_register(handle, "chat-inviting-user", |
| 2754 | purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, | |
| 2755 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2756 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2757 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2758 | purple_value_new_outgoing(PURPLE_TYPE_STRING)); | |
| 2759 | ||
| 2760 | purple_signal_register(handle, "chat-invited-user", | |
| 2761 | purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, | |
| 2762 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2763 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2764 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2765 | purple_value_new(PURPLE_TYPE_STRING)); | |
| 2766 | ||
| 2767 | purple_signal_register(handle, "chat-invited", | |
| 2768 | purple_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER, | |
|
20420
74b2d096bfe2
chat-invited handlers return an interger value.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19904
diff
changeset
|
2769 | purple_value_new(PURPLE_TYPE_INT), 5, |
| 15884 | 2770 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
| 2771 | PURPLE_SUBTYPE_ACCOUNT), | |
| 2772 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2773 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2774 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2775 | purple_value_new(PURPLE_TYPE_POINTER)); | |
| 2776 | ||
|
23312
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2777 | purple_signal_register(handle, "chat-invite-blocked", |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2778 | purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_POINTER, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2779 | NULL, 5, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2780 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2781 | PURPLE_SUBTYPE_ACCOUNT), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2782 | purple_value_new(PURPLE_TYPE_STRING), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2783 | purple_value_new(PURPLE_TYPE_STRING), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2784 | purple_value_new(PURPLE_TYPE_STRING), |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2785 | purple_value_new(PURPLE_TYPE_BOXED, "GHashTable *")); |
|
0530decb56e4
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23278
diff
changeset
|
2786 | |
| 15884 | 2787 | purple_signal_register(handle, "chat-joined", |
| 2788 | purple_marshal_VOID__POINTER, NULL, 1, | |
| 2789 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2790 | PURPLE_SUBTYPE_CONVERSATION)); | |
| 2791 | ||
|
22920
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22918
diff
changeset
|
2792 | purple_signal_register(handle, "chat-join-failed", |
|
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22918
diff
changeset
|
2793 | purple_marshal_VOID__POINTER_POINTER, NULL, 2, |
|
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22918
diff
changeset
|
2794 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22918
diff
changeset
|
2795 | PURPLE_SUBTYPE_CONNECTION), |
|
23270
2b7db16e721a
As discussed on the devel list, purple_serv_got_join_chat_failed() and the
Evan Schoenberg <evands@pidgin.im>
parents:
22920
diff
changeset
|
2796 | purple_value_new(PURPLE_TYPE_POINTER)); |
|
22920
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22918
diff
changeset
|
2797 | |
| 15884 | 2798 | purple_signal_register(handle, "chat-left", |
| 2799 | purple_marshal_VOID__POINTER, NULL, 1, | |
| 2800 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2801 | PURPLE_SUBTYPE_CONVERSATION)); | |
| 2802 | ||
| 2803 | purple_signal_register(handle, "chat-topic-changed", | |
| 2804 | purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3, | |
| 2805 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2806 | PURPLE_SUBTYPE_CONVERSATION), | |
| 2807 | purple_value_new(PURPLE_TYPE_STRING), | |
| 2808 | purple_value_new(PURPLE_TYPE_STRING)); | |
|
17265
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2809 | |
|
31643
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2810 | purple_signal_register(handle, "cleared-message-history", |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2811 | purple_marshal_VOID__POINTER, NULL, 1, |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2812 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2813 | PURPLE_SUBTYPE_CONVERSATION)); |
|
805b37d317a2
Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <darkrain42@pidgin.im>
parents:
31602
diff
changeset
|
2814 | |
|
17265
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2815 | purple_signal_register(handle, "conversation-extended-menu", |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2816 | purple_marshal_VOID__POINTER_POINTER, NULL, 2, |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2817 | purple_value_new(PURPLE_TYPE_SUBTYPE, |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2818 | PURPLE_SUBTYPE_CONVERSATION), |
|
fd5b0ca330a3
New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17155
diff
changeset
|
2819 | purple_value_new(PURPLE_TYPE_BOXED, "GList **")); |
| 5858 | 2820 | } |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2821 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2822 | void |
| 15884 | 2823 | purple_conversations_uninit(void) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2824 | { |
|
9909
b13c36f7d52b
[gaim-migrate @ 10801]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9846
diff
changeset
|
2825 | while (conversations) |
| 15884 | 2826 | purple_conversation_destroy((PurpleConversation*)conversations->data); |
|
27967
01a64c630e35
More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents:
27954
diff
changeset
|
2827 | g_hash_table_destroy(conversation_cache); |
| 15884 | 2828 | purple_signals_unregister_by_instance(purple_conversations_get_handle()); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6478
diff
changeset
|
2829 | } |
|
19904
8abf4c2056eb
Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19859
diff
changeset
|
2830 |