Sun, 01 Sep 2013 00:38:40 +0530
Renamed purple_find_protocol_info to purple_protocols_find
| 1 | 1 | /* |
| 15884 | 2 | * purple |
| 1 | 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. | |
| 1 | 7 | * |
| 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:
19673
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 1 | 21 | * |
| 22 | */ | |
| 16795 | 23 | |
| 24 | /* This file is the fullcrap */ | |
| 25 | ||
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
26 | #include "internal.h" |
|
34706
02cb08146888
Renamed blist.[ch] to buddylist.[ch]
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
27 | #include "buddylist.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
28 | #include "conversation.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
29 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
30 | #include "log.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
31 | #include "notify.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
32 | #include "prefs.h" |
|
36543
a8c3fecee2d3
Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents:
36376
diff
changeset
|
33 | #include "protocol.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
34 | #include "request.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
35 | #include "signals.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
36 | #include "server.h" |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9933
diff
changeset
|
37 | #include "status.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
38 | #include "util.h" |
| 1 | 39 | |
|
8948
a5ec0dd1f46c
[gaim-migrate @ 9720]
Mark Doliner <markdoliner@pidgin.im>
parents:
8904
diff
changeset
|
40 | #define SECS_BEFORE_RESENDING_AUTORESPONSE 600 |
|
9285
9cedf5d26577
[gaim-migrate @ 10088]
Mark Doliner <markdoliner@pidgin.im>
parents:
9237
diff
changeset
|
41 | #define SEX_BEFORE_RESENDING_AUTORESPONSE "Only after you're married" |
|
8948
a5ec0dd1f46c
[gaim-migrate @ 9720]
Mark Doliner <markdoliner@pidgin.im>
parents:
8904
diff
changeset
|
42 | |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13791
diff
changeset
|
43 | unsigned int |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
44 | serv_send_typing(PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13791
diff
changeset
|
45 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
46 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
47 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
48 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
49 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
50 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
51 | if (protocol->send_typing) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
52 | return purple_protocol_iface_send_typing(protocol, gc, name, state); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
53 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
54 | |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
55 | return 0; |
| 2993 | 56 | } |
| 1 | 57 | |
|
10871
c0282a4f2250
[gaim-migrate @ 12558]
Mark Doliner <markdoliner@pidgin.im>
parents:
10853
diff
changeset
|
58 | static GSList *last_auto_responses = NULL; |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
59 | struct last_auto_response { |
| 15884 | 60 | PurpleConnection *gc; |
|
3815
111911707a8c
[gaim-migrate @ 3962]
Joshua Blanton <jblanton@cs.ohiou.edu>
parents:
3792
diff
changeset
|
61 | char name[80]; |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
62 | time_t sent; |
|
3815
111911707a8c
[gaim-migrate @ 3962]
Joshua Blanton <jblanton@cs.ohiou.edu>
parents:
3792
diff
changeset
|
63 | }; |
|
111911707a8c
[gaim-migrate @ 3962]
Joshua Blanton <jblanton@cs.ohiou.edu>
parents:
3792
diff
changeset
|
64 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10827
diff
changeset
|
65 | static gboolean |
|
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10827
diff
changeset
|
66 | expire_last_auto_responses(gpointer data) |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
67 | { |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
68 | GSList *tmp, *cur; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
69 | struct last_auto_response *lar; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
70 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
71 | tmp = last_auto_responses; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
72 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
73 | while (tmp) { |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
74 | cur = tmp; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
75 | tmp = tmp->next; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
76 | lar = (struct last_auto_response *)cur->data; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
77 | |
|
8948
a5ec0dd1f46c
[gaim-migrate @ 9720]
Mark Doliner <markdoliner@pidgin.im>
parents:
8904
diff
changeset
|
78 | if ((time(NULL) - lar->sent) > SECS_BEFORE_RESENDING_AUTORESPONSE) { |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
79 | last_auto_responses = g_slist_remove(last_auto_responses, lar); |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
80 | g_free(lar); |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
81 | } |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
82 | } |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
83 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
84 | return FALSE; /* do not run again */ |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
85 | } |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
86 | |
|
10850
6889f793b918
[gaim-migrate @ 12522]
Mark Doliner <markdoliner@pidgin.im>
parents:
10827
diff
changeset
|
87 | static struct last_auto_response * |
| 15884 | 88 | get_last_auto_response(PurpleConnection *gc, const char *name) |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
89 | { |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
90 | GSList *tmp; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
91 | struct last_auto_response *lar; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
92 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
93 | /* because we're modifying or creating a lar, schedule the |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
94 | * function to expire them as the pref dictates */ |
|
18068
b6554e3c8224
merge of '1442df274a24edc9a31194327bd00dfbcf478720'
Richard Laager <rlaager@pidgin.im>
diff
changeset
|
95 | purple_timeout_add_seconds((SECS_BEFORE_RESENDING_AUTORESPONSE + 1), expire_last_auto_responses, NULL); |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
96 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
97 | tmp = last_auto_responses; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
98 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
99 | while (tmp) { |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
100 | lar = (struct last_auto_response *)tmp->data; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
101 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
102 | if (gc == lar->gc && !strncmp(name, lar->name, sizeof(lar->name))) |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
103 | return lar; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
104 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
105 | tmp = tmp->next; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
106 | } |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
107 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
108 | lar = (struct last_auto_response *)g_new0(struct last_auto_response, 1); |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
109 | g_snprintf(lar->name, sizeof(lar->name), "%s", name); |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
110 | lar->gc = gc; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
111 | lar->sent = 0; |
|
13791
df2a8738c602
[gaim-migrate @ 16201]
Richard Laager <rlaager@pidgin.im>
parents:
13664
diff
changeset
|
112 | last_auto_responses = g_slist_prepend(last_auto_responses, lar); |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
113 | |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
114 | return lar; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
115 | } |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
116 | |
| 15884 | 117 | int serv_send_im(PurpleConnection *gc, const char *name, const char *message, |
| 118 | PurpleMessageFlags flags) | |
| 1 | 119 | { |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
120 | PurpleIMConversation *im = NULL; |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
121 | PurpleAccount *account = NULL; |
|
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
122 | PurplePresence *presence = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
123 | PurpleProtocol *protocol = NULL; |
|
2123
4cfdde0aa3f1
[gaim-migrate @ 2133]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2108
diff
changeset
|
124 | int val = -EINVAL; |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
125 | const gchar *auto_reply_pref = NULL; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
126 | |
|
13422
0221ca926ebe
[gaim-migrate @ 15796]
Richard Laager <rlaager@pidgin.im>
parents:
13418
diff
changeset
|
127 | g_return_val_if_fail(gc != NULL, val); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
128 | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
129 | protocol = purple_connection_get_protocol(gc); |
|
13422
0221ca926ebe
[gaim-migrate @ 15796]
Richard Laager <rlaager@pidgin.im>
parents:
13418
diff
changeset
|
130 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
131 | g_return_val_if_fail(protocol != NULL, val); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
132 | |
| 15884 | 133 | account = purple_connection_get_account(gc); |
| 134 | presence = purple_account_get_presence(account); | |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
135 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
136 | im = purple_conversations_find_im_with_account(name, account); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
137 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
138 | if (protocol->send_im) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
139 | val = purple_protocol_iface_send_im(protocol, gc, name, message, flags); |
|
94
0c6ba3d3fa90
[gaim-migrate @ 104]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
79
diff
changeset
|
140 | |
|
9594
7a1f902b9494
[gaim-migrate @ 10437]
Mark Doliner <markdoliner@pidgin.im>
parents:
9584
diff
changeset
|
141 | /* |
|
7a1f902b9494
[gaim-migrate @ 10437]
Mark Doliner <markdoliner@pidgin.im>
parents:
9584
diff
changeset
|
142 | * XXX - If "only auto-reply when away & idle" is set, then shouldn't |
|
7a1f902b9494
[gaim-migrate @ 10437]
Mark Doliner <markdoliner@pidgin.im>
parents:
9584
diff
changeset
|
143 | * this only reset lar->sent if we're away AND idle? |
|
7a1f902b9494
[gaim-migrate @ 10437]
Mark Doliner <markdoliner@pidgin.im>
parents:
9584
diff
changeset
|
144 | */ |
|
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
|
145 | auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply"); |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
146 | if((purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_AUTO_RESP) && |
| 15884 | 147 | !purple_presence_is_available(presence) && |
|
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:
25854
diff
changeset
|
148 | !purple_strequal(auto_reply_pref, "never")) { |
|
5545
a8b1a1262402
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
149 | |
|
6479
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
150 | struct last_auto_response *lar; |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
151 | lar = get_last_auto_response(gc, name); |
|
ed29d5b112b5
[gaim-migrate @ 6992]
Robert McQueen <robot101@debian.org>
parents:
6478
diff
changeset
|
152 | lar->sent = time(NULL); |
|
3815
111911707a8c
[gaim-migrate @ 3962]
Joshua Blanton <jblanton@cs.ohiou.edu>
parents:
3792
diff
changeset
|
153 | } |
|
111911707a8c
[gaim-migrate @ 3962]
Joshua Blanton <jblanton@cs.ohiou.edu>
parents:
3792
diff
changeset
|
154 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
155 | if(im && purple_im_conversation_get_send_typed_timeout(im)) |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
156 | purple_im_conversation_stop_send_typed_timeout(im); |
| 3601 | 157 | |
|
2123
4cfdde0aa3f1
[gaim-migrate @ 2133]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2108
diff
changeset
|
158 | return val; |
| 1 | 159 | } |
| 160 | ||
| 15884 | 161 | void serv_get_info(PurpleConnection *gc, const char *name) |
| 1 | 162 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
163 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
164 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
165 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
166 | protocol = purple_connection_get_protocol(gc); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
167 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
168 | if (protocol->get_info) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
169 | purple_protocol_iface_get_info(protocol, gc, name); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
170 | } |
|
249
14b7e4f943ff
[gaim-migrate @ 259]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
248
diff
changeset
|
171 | } |
|
14b7e4f943ff
[gaim-migrate @ 259]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
248
diff
changeset
|
172 | |
| 15884 | 173 | void serv_set_info(PurpleConnection *gc, const char *info) |
| 1 | 174 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
175 | PurpleProtocol *protocol; |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
176 | PurpleAccount *account; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
177 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
178 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
179 | protocol = purple_connection_get_protocol(gc); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
180 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
181 | if (protocol->set_info) { |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
182 | account = purple_connection_get_account(gc); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
183 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
184 | if (purple_signal_emit_return_1(purple_accounts_get_handle(), |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
185 | "account-setting-info", account, info)) |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
186 | return; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
187 | |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
188 | purple_protocol_iface_set_info(protocol, gc, info); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
189 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
190 | purple_signal_emit(purple_accounts_get_handle(), |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
191 | "account-set-info", account, info); |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
192 | } |
| 1749 | 193 | } |
|
237
83ff5f92ee7e
[gaim-migrate @ 247]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
200
diff
changeset
|
194 | } |
|
83ff5f92ee7e
[gaim-migrate @ 247]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
200
diff
changeset
|
195 | |
| 3136 | 196 | /* |
| 197 | * Set buddy's alias on server roster/list | |
| 198 | */ | |
| 15884 | 199 | void serv_alias_buddy(PurpleBuddy *b) |
| 3136 | 200 | { |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
201 | PurpleAccount *account; |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
202 | PurpleConnection *gc; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
203 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
204 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
205 | if (b) { |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
206 | account = purple_buddy_get_account(b); |
|
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
207 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
208 | if (account) { |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
209 | gc = purple_account_get_connection(account); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
210 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
211 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
212 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
213 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
214 | if (protocol->alias_buddy) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
215 | purple_protocol_iface_alias_buddy(protocol, gc, |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
216 | purple_buddy_get_name(b), |
|
34717
b3e588adef5a
Global replace purple_buddy_get_local_buddy_alias() with purple_buddy_get_local_alias()
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
217 | purple_buddy_get_local_alias(b)); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
218 | } |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
219 | } |
| 3136 | 220 | } |
| 221 | } | |
| 222 | ||
| 9135 | 223 | void |
| 15884 | 224 | serv_got_alias(PurpleConnection *gc, const char *who, const char *alias) |
| 9135 | 225 | { |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
226 | PurpleAccount *account; |
|
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
227 | GSList *buddies; |
| 15884 | 228 | PurpleBuddy *b; |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
229 | PurpleIMConversation *im; |
|
6058
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6019
diff
changeset
|
230 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
231 | account = purple_connection_get_account(gc); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
232 | buddies = purple_blist_find_buddies(account, who); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
233 | |
|
16863
b98303c15033
Change a few functions to free a linked list while iterating through
Mark Doliner <markdoliner@pidgin.im>
parents:
16795
diff
changeset
|
234 | while (buddies != NULL) |
| 9135 | 235 | { |
|
24957
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
236 | const char *server_alias; |
|
24955
77727fac30c6
Finish off the libpurple updates for the hidden blist structs
Gary Kramlich <grim@reaperworld.com>
parents:
24526
diff
changeset
|
237 | |
|
16863
b98303c15033
Change a few functions to free a linked list while iterating through
Mark Doliner <markdoliner@pidgin.im>
parents:
16795
diff
changeset
|
238 | b = buddies->data; |
|
b98303c15033
Change a few functions to free a linked list while iterating through
Mark Doliner <markdoliner@pidgin.im>
parents:
16795
diff
changeset
|
239 | buddies = g_slist_delete_link(buddies, buddies); |
|
b98303c15033
Change a few functions to free a linked list while iterating through
Mark Doliner <markdoliner@pidgin.im>
parents:
16795
diff
changeset
|
240 | |
|
24957
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
241 | server_alias = purple_buddy_get_server_alias(b); |
|
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:
25854
diff
changeset
|
242 | |
|
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:
25854
diff
changeset
|
243 | if (purple_strequal(server_alias, alias)) |
| 14546 | 244 | continue; |
|
16863
b98303c15033
Change a few functions to free a linked list while iterating through
Mark Doliner <markdoliner@pidgin.im>
parents:
16795
diff
changeset
|
245 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
246 | purple_buddy_set_server_alias(b, alias); |
| 9135 | 247 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
248 | im = purple_conversations_find_im_with_account(purple_buddy_get_name(b), account); |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
249 | if (im != NULL && alias != NULL && !purple_strequal(alias, who)) |
| 9135 | 250 | { |
|
24526
c302510b1137
escape nick change message
Ka-Hing Cheung <khc@pidgin.im>
parents:
23875
diff
changeset
|
251 | char *escaped = g_markup_escape_text(who, -1); |
|
c302510b1137
escape nick change message
Ka-Hing Cheung <khc@pidgin.im>
parents:
23875
diff
changeset
|
252 | char *escaped2 = g_markup_escape_text(alias, -1); |
| 9135 | 253 | char *tmp = g_strdup_printf(_("%s is now known as %s.\n"), |
|
24526
c302510b1137
escape nick change message
Ka-Hing Cheung <khc@pidgin.im>
parents:
23875
diff
changeset
|
254 | escaped, escaped2); |
| 9135 | 255 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
256 | purple_conversation_write(PURPLE_CONVERSATION(im), NULL, tmp, |
| 18090 | 257 | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
| 258 | time(NULL)); | |
| 9135 | 259 | |
| 260 | g_free(tmp); | |
|
24526
c302510b1137
escape nick change message
Ka-Hing Cheung <khc@pidgin.im>
parents:
23875
diff
changeset
|
261 | g_free(escaped2); |
|
c302510b1137
escape nick change message
Ka-Hing Cheung <khc@pidgin.im>
parents:
23875
diff
changeset
|
262 | g_free(escaped); |
| 9135 | 263 | } |
| 8870 | 264 | } |
| 4227 | 265 | } |
| 266 | ||
|
22474
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
267 | void |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
268 | purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias) |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
269 | { |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
270 | PurpleAccount *account = NULL; |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
271 | GSList *buddies = NULL; |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
272 | PurpleBuddy *b = NULL; |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
273 | |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
274 | account = purple_connection_get_account(gc); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
275 | buddies = purple_blist_find_buddies(account, who); |
|
22474
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
276 | |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
277 | while(buddies != NULL) { |
|
24957
647853a842da
A couple of minor fixes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
24955
diff
changeset
|
278 | const char *balias; |
|
22474
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
279 | b = buddies->data; |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
280 | |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
281 | buddies = g_slist_delete_link(buddies, buddies); |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
282 | |
|
34717
b3e588adef5a
Global replace purple_buddy_get_local_buddy_alias() with purple_buddy_get_local_alias()
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
283 | balias = purple_buddy_get_local_alias(b); |
|
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:
25854
diff
changeset
|
284 | if (purple_strequal(balias, alias)) |
|
22474
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
285 | continue; |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
286 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
287 | purple_buddy_set_local_alias(b, alias); |
|
22474
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
288 | } |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
289 | } |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
290 | |
|
d08590a6660c
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22390
diff
changeset
|
291 | |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
292 | PurpleAttentionType *purple_get_attention_type_from_code(PurpleAccount *account, guint type_code) |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
293 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
294 | PurpleProtocol *protocol; |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
295 | PurpleAttentionType* attn; |
|
19641
4a93c044199c
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19639
diff
changeset
|
296 | GList *(*get_attention_types)(PurpleAccount *); |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
297 | |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
298 | g_return_val_if_fail(account != NULL, NULL); |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
299 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36623
diff
changeset
|
300 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
301 | |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
302 | /* Lookup the attention type in the protocol's attention_types list, if any. */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
303 | get_attention_types = protocol->get_attention_types; |
|
19641
4a93c044199c
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19639
diff
changeset
|
304 | if (get_attention_types) { |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
305 | GList *attention_types; |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
306 | |
|
19641
4a93c044199c
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19639
diff
changeset
|
307 | attention_types = get_attention_types(account); |
|
19639
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
308 | attn = (PurpleAttentionType *)g_list_nth_data(attention_types, type_code); |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
309 | } else { |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
310 | attn = NULL; |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
311 | } |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
312 | |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
313 | return attn; |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
314 | } |
|
93a56951f439
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
19632
diff
changeset
|
315 | |
|
19604
ae3d7cc7063d
Attention API for nudges/buzzes/zaps of various protocols.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
18311
diff
changeset
|
316 | |
| 3136 | 317 | /* |
| 318 | * Move a buddy from one group to another on server. | |
| 319 | * | |
| 320 | * Note: For now we'll not deal with changing gc's at the same time, but | |
|
9285
9cedf5d26577
[gaim-migrate @ 10088]
Mark Doliner <markdoliner@pidgin.im>
parents:
9237
diff
changeset
|
321 | * it should be possible. Probably needs to be done, someday. Although, |
| 15884 | 322 | * the UI for that would be difficult, because groups are Purple-wide. |
| 3136 | 323 | */ |
| 15884 | 324 | void serv_move_buddy(PurpleBuddy *b, PurpleGroup *og, PurpleGroup *ng) |
| 3136 | 325 | { |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
326 | PurpleAccount *account; |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
327 | PurpleConnection *gc; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
328 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
329 | |
|
13418
676c3eb505dc
[gaim-migrate @ 15792]
Richard Laager <rlaager@pidgin.im>
parents:
13294
diff
changeset
|
330 | g_return_if_fail(b != NULL); |
|
676c3eb505dc
[gaim-migrate @ 15792]
Richard Laager <rlaager@pidgin.im>
parents:
13294
diff
changeset
|
331 | g_return_if_fail(og != NULL); |
|
676c3eb505dc
[gaim-migrate @ 15792]
Richard Laager <rlaager@pidgin.im>
parents:
13294
diff
changeset
|
332 | g_return_if_fail(ng != NULL); |
|
676c3eb505dc
[gaim-migrate @ 15792]
Richard Laager <rlaager@pidgin.im>
parents:
13294
diff
changeset
|
333 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
334 | account = purple_buddy_get_account(b); |
|
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
335 | gc = purple_account_get_connection(account); |
|
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
336 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
337 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
338 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
339 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
340 | if (protocol->group_buddy) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
341 | purple_protocol_iface_group_buddy(protocol, gc, purple_buddy_get_name(b), |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
342 | purple_group_get_name(og), |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
343 | purple_group_get_name(ng)); |
| 3136 | 344 | } |
| 345 | } | |
| 346 | ||
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
347 | void serv_add_permit(PurpleConnection *gc, const char *name) |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
348 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
349 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
350 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
351 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
352 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
353 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
354 | if (protocol->add_permit) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
355 | purple_protocol_iface_add_permit(protocol, gc, name); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
356 | } |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
357 | } |
|
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
358 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
359 | void serv_add_deny(PurpleConnection *gc, const char *name) |
| 1 | 360 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
361 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
362 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
363 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
364 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
365 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
366 | if (protocol->add_deny) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
367 | purple_protocol_iface_add_deny(protocol, gc, name); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
368 | } |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
369 | } |
|
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
370 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
371 | void serv_rem_permit(PurpleConnection *gc, const char *name) |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
372 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
373 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
374 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
375 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
376 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
377 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
378 | if (protocol->rem_permit) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
379 | purple_protocol_iface_rem_permit(protocol, gc, name); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
380 | } |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
381 | } |
| 1 | 382 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
383 | void serv_rem_deny(PurpleConnection *gc, const char *name) |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
384 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
385 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
386 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
387 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
388 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
389 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
390 | if (protocol->rem_deny) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
391 | purple_protocol_iface_rem_deny(protocol, gc, name); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
392 | } |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
393 | } |
|
678
6e2cb341573a
[gaim-migrate @ 688]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
660
diff
changeset
|
394 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
395 | void serv_set_permit_deny(PurpleConnection *gc) |
|
1030
b9fa9eadc0a4
[gaim-migrate @ 1040]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1026
diff
changeset
|
396 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
397 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
398 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
399 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
400 | protocol = purple_connection_get_protocol(gc); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
401 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
402 | /* |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
403 | * this is called when either you import a buddy list, and make lots |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
404 | * of changes that way, or when the user toggles the permit/deny mode |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
405 | * in the prefs. In either case you should probably be resetting and |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
406 | * resending the permit/deny info when you get this. |
|
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
407 | */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
408 | if (protocol->set_permit_deny) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
409 | purple_protocol_iface_set_permit_deny(protocol, gc); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
410 | } |
| 1 | 411 | } |
| 412 | ||
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
413 | void serv_join_chat(PurpleConnection *gc, GHashTable *data) |
| 1 | 414 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
415 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
416 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
417 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
418 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
419 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
420 | if (protocol->join_chat) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
421 | purple_protocol_iface_join_chat(protocol, gc, data); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
422 | } |
| 1 | 423 | } |
| 424 | ||
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
425 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
426 | void serv_reject_chat(PurpleConnection *gc, GHashTable *data) |
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
427 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
428 | PurpleProtocol *protocol; |
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
429 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
430 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
431 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
432 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
433 | if (protocol->reject_chat) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
434 | purple_protocol_iface_reject_chat(protocol, gc, data); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
435 | } |
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
436 | } |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
437 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
438 | void serv_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name) |
| 1 | 439 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
440 | PurpleProtocol *protocol = NULL; |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
441 | PurpleChatConversation *chat; |
|
2359
27c1207ca513
[gaim-migrate @ 2372]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2345
diff
changeset
|
442 | char *buffy = message && *message ? g_strdup(message) : NULL; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
443 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
444 | chat = purple_conversations_find_chat(gc, id); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
445 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
446 | if(chat == NULL) |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
447 | return; |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
448 | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
449 | if(gc) |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
450 | protocol = purple_connection_get_protocol(gc); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
451 | |
| 15884 | 452 | purple_signal_emit(purple_conversations_get_handle(), "chat-inviting-user", |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
453 | chat, name, &buffy); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
454 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
455 | if (protocol && protocol->chat_invite) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
456 | purple_protocol_iface_chat_invite(protocol, gc, id, buffy, name); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
457 | |
| 15884 | 458 | purple_signal_emit(purple_conversations_get_handle(), "chat-invited-user", |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
459 | chat, name, buffy); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
460 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13995
diff
changeset
|
461 | g_free(buffy); |
| 1 | 462 | } |
| 463 | ||
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
464 | /* Ya know, nothing uses this except purple_chat_conversation_dispose(), |
| 8256 | 465 | * I think I'll just merge it into that later... |
| 466 | * Then again, something might want to use this, from outside prpl-land | |
| 467 | * to leave a chat without destroying the conversation. | |
| 468 | */ | |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
469 | void serv_chat_leave(PurpleConnection *gc, int id) |
| 1 | 470 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
471 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
472 | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
473 | protocol = purple_connection_get_protocol(gc); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
474 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
475 | if (protocol->chat_leave) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
476 | purple_protocol_iface_chat_leave(protocol, gc, id); |
| 1 | 477 | } |
| 478 | ||
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
479 | void serv_chat_whisper(PurpleConnection *gc, int id, const char *who, const char *message) |
| 1 | 480 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
481 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
482 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
483 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
484 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
485 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
486 | if (protocol->chat_whisper) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
487 | purple_protocol_iface_chat_whisper(protocol, gc, id, who, message); |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
488 | } |
| 1 | 489 | } |
| 490 | ||
| 15884 | 491 | int serv_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
| 1 | 492 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
493 | PurpleProtocol *protocol; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
494 | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
495 | protocol = purple_connection_get_protocol(gc); |
|
22390
d22357d5c7ba
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21175
diff
changeset
|
496 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
497 | if (protocol->chat_send) |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
498 | return purple_protocol_iface_chat_send(protocol, gc, id, message, flags); |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5170
diff
changeset
|
499 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
500 | return -EINVAL; |
| 1 | 501 | } |
| 502 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
503 | /* |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
504 | * woo. i'm actually going to comment this function. isn't that fun. make |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
505 | * sure to follow along, kids |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
506 | */ |
| 15884 | 507 | void serv_got_im(PurpleConnection *gc, const char *who, const char *msg, |
| 508 | PurpleMessageFlags flags, time_t mtime) | |
| 1 | 509 | { |
| 15884 | 510 | PurpleAccount *account; |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
511 | PurpleIMConversation *im; |
| 5136 | 512 | char *message, *name; |
|
6622
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6621
diff
changeset
|
513 | char *angel, *buffy; |
|
277eb0b14653
[gaim-migrate @ 7146]
Robert McQueen <robot101@debian.org>
parents:
6621
diff
changeset
|
514 | int plugin_return; |
|
2273
b7c08d737d81
[gaim-migrate @ 2283]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2231
diff
changeset
|
515 | |
|
11903
56ae8af14a0d
[gaim-migrate @ 14194]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11818
diff
changeset
|
516 | g_return_if_fail(msg != NULL); |
|
56ae8af14a0d
[gaim-migrate @ 14194]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11818
diff
changeset
|
517 | |
| 15884 | 518 | account = purple_connection_get_account(gc); |
| 12849 | 519 | |
|
25721
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
520 | /* |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
521 | * XXX: Should we be setting this here, or relying on prpls to set it? |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
522 | */ |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
523 | flags |= PURPLE_MESSAGE_RECV; |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
524 | |
|
34583
476c39afcaae
Refactored the libpurple core to use the GObject-based PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
32678
diff
changeset
|
525 | if (!purple_account_privacy_check(account, who)) { |
|
28236
3827fe6f94e0
Check in a change that does dumb client-side blocking of people
Mark Doliner <markdoliner@pidgin.im>
parents:
27935
diff
changeset
|
526 | purple_signal_emit(purple_conversations_get_handle(), "blocked-im-msg", |
|
3827fe6f94e0
Check in a change that does dumb client-side blocking of people
Mark Doliner <markdoliner@pidgin.im>
parents:
27935
diff
changeset
|
527 | account, who, msg, flags, (unsigned int)mtime); |
|
3827fe6f94e0
Check in a change that does dumb client-side blocking of people
Mark Doliner <markdoliner@pidgin.im>
parents:
27935
diff
changeset
|
528 | return; |
| 12849 | 529 | } |
| 530 | ||
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
531 | /* |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
532 | * We should update the conversation window buttons and menu, |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
533 | * if it exists. |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
534 | */ |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
535 | im = purple_conversations_find_im_with_account(who, purple_connection_get_account(gc)); |
|
2106
ecd1bec6376c
[gaim-migrate @ 2116]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2104
diff
changeset
|
536 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
537 | /* |
|
20641
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
538 | * Make copies of the message and the sender in case plugins want |
|
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
539 | * to free these strings and replace them with a modifed version. |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
540 | */ |
|
20641
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
541 | buffy = g_strdup(msg); |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
542 | angel = g_strdup(who); |
| 1339 | 543 | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
544 | plugin_return = GPOINTER_TO_INT( |
| 15884 | 545 | purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
546 | "receiving-im-msg", purple_connection_get_account(gc), |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
547 | &angel, &buffy, im, &flags)); |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
548 | |
|
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
549 | if (!buffy || !angel || plugin_return) { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13995
diff
changeset
|
550 | g_free(buffy); |
|
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13995
diff
changeset
|
551 | g_free(angel); |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
552 | return; |
|
1100
efc7d10c7826
[gaim-migrate @ 1110]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1089
diff
changeset
|
553 | } |
| 8619 | 554 | |
| 8999 | 555 | name = angel; |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6885
diff
changeset
|
556 | message = buffy; |
|
2104
8d12ab6f798c
[gaim-migrate @ 2114]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2090
diff
changeset
|
557 | |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
558 | purple_signal_emit(purple_conversations_get_handle(), "received-im-msg", purple_connection_get_account(gc), |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
559 | name, message, im, flags); |
| 8999 | 560 | |
|
12288
d3452b226853
[gaim-migrate @ 14592]
Casey Harkins <charkins@pidgin.im>
parents:
12281
diff
changeset
|
561 | /* search for conversation again in case it was created by received-im-msg handler */ |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
562 | if (im == NULL) |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
563 | im = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc)); |
|
12288
d3452b226853
[gaim-migrate @ 14592]
Casey Harkins <charkins@pidgin.im>
parents:
12281
diff
changeset
|
564 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
565 | if (im == NULL) |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
566 | im = purple_im_conversation_new(account, name); |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
567 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
568 | purple_conversation_write_message(PURPLE_CONVERSATION(im), name, message, flags, mtime); |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
569 | g_free(message); |
|
12116
17bf39d2678f
[gaim-migrate @ 14416]
Casey Harkins <charkins@pidgin.im>
parents:
12114
diff
changeset
|
570 | |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
571 | /* |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
572 | * Don't autorespond if: |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
573 | * |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
574 | * - it's not supported on this connection |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
575 | * - we are available |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
576 | * - or it's disabled |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
577 | * - or we're not idle and the 'only auto respond if idle' pref |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
578 | * is set |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
579 | */ |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
580 | if (purple_connection_get_flags(gc) & PURPLE_CONNECTION_FLAG_AUTO_RESP) |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
581 | { |
| 15884 | 582 | PurplePresence *presence; |
| 583 | PurpleStatus *status; | |
| 584 | PurpleStatusType *status_type; | |
| 585 | PurpleStatusPrimitive primitive; | |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
586 | const gchar *auto_reply_pref; |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
587 | const char *away_msg = NULL; |
|
23523
43487fb86f1e
Mobile status are created as independant statuses, which cannot be the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23436
diff
changeset
|
588 | gboolean mobile = FALSE; |
|
1775
16de02b8c378
[gaim-migrate @ 1785]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1774
diff
changeset
|
589 | |
|
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
|
590 | auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply"); |
|
10052
329dad7e2da3
[gaim-migrate @ 11013]
Dave West <kat@users.sourceforge.net>
parents:
10011
diff
changeset
|
591 | |
| 15884 | 592 | presence = purple_account_get_presence(account); |
| 593 | status = purple_presence_get_active_status(presence); | |
|
34855
9c289149eed4
Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents:
34821
diff
changeset
|
594 | status_type = purple_status_get_status_type(status); |
| 15884 | 595 | primitive = purple_status_type_get_primitive(status_type); |
|
23523
43487fb86f1e
Mobile status are created as independant statuses, which cannot be the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23436
diff
changeset
|
596 | mobile = purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE); |
| 15884 | 597 | if ((primitive == PURPLE_STATUS_AVAILABLE) || |
| 598 | (primitive == PURPLE_STATUS_INVISIBLE) || | |
|
23523
43487fb86f1e
Mobile status are created as independant statuses, which cannot be the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23436
diff
changeset
|
599 | mobile || |
|
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:
25854
diff
changeset
|
600 | purple_strequal(auto_reply_pref, "never") || |
|
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:
25854
diff
changeset
|
601 | (!purple_presence_is_idle(presence) && purple_strequal(auto_reply_pref, "awayidle"))) |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
602 | { |
|
2104
8d12ab6f798c
[gaim-migrate @ 2114]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2090
diff
changeset
|
603 | g_free(name); |
|
1775
16de02b8c378
[gaim-migrate @ 1785]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1774
diff
changeset
|
604 | return; |
|
2104
8d12ab6f798c
[gaim-migrate @ 2114]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2090
diff
changeset
|
605 | } |
|
1775
16de02b8c378
[gaim-migrate @ 1785]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1774
diff
changeset
|
606 | |
|
34821
0e27ec95be63
Refactored plugin, savedstatuses and server to use GType and GValue instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34755
diff
changeset
|
607 | away_msg = g_value_get_string( |
| 15884 | 608 | purple_status_get_attr_value(status, "message")); |
|
1775
16de02b8c378
[gaim-migrate @ 1785]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1774
diff
changeset
|
609 | |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
610 | if ((away_msg != NULL) && (*away_msg != '\0')) { |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
611 | struct last_auto_response *lar; |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
612 | time_t now = time(NULL); |
|
10052
329dad7e2da3
[gaim-migrate @ 11013]
Dave West <kat@users.sourceforge.net>
parents:
10011
diff
changeset
|
613 | |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
614 | /* |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
615 | * This used to be based on the conversation window. But um, if |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
616 | * you went away, and someone sent you a message and got your |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
617 | * auto-response, and then you closed the window, and then they |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
618 | * sent you another one, they'd get the auto-response back too |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
619 | * soon. Besides that, we need to keep track of this even if we've |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
620 | * got a queue. So the rest of this block is just the auto-response, |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
621 | * if necessary. |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
622 | */ |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
623 | lar = get_last_auto_response(gc, name); |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
624 | if ((now - lar->sent) >= SECS_BEFORE_RESENDING_AUTORESPONSE) |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
625 | { |
|
13995
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
626 | /* |
|
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
627 | * We don't want to send an autoresponse in response to the other user's |
|
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
628 | * autoresponse. We do, however, not want to then send one in response to the |
|
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
629 | * _next_ message, so we still set lar->sent to now. |
|
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
630 | */ |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
631 | lar->sent = now; |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13995
diff
changeset
|
632 | |
| 15884 | 633 | if (!(flags & PURPLE_MESSAGE_AUTO_RESP)) |
|
13995
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
634 | { |
| 15884 | 635 | serv_send_im(gc, name, away_msg, PURPLE_MESSAGE_AUTO_RESP); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
636 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
637 | purple_conversation_write_message(PURPLE_CONVERSATION(im), NULL, away_msg, |
| 15884 | 638 | PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_AUTO_RESP, |
|
13995
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
639 | mtime); |
|
d49d169477cd
[gaim-migrate @ 16461]
Evan Schoenberg <evands@pidgin.im>
parents:
13985
diff
changeset
|
640 | } |
|
12949
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
641 | } |
|
525bbe926760
[gaim-migrate @ 15302]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12894
diff
changeset
|
642 | } |
| 1 | 643 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
644 | |
|
2104
8d12ab6f798c
[gaim-migrate @ 2114]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2090
diff
changeset
|
645 | g_free(name); |
| 1 | 646 | } |
| 647 | ||
| 15884 | 648 | void serv_got_typing(PurpleConnection *gc, const char *name, int timeout, |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
649 | PurpleIMTypingState state) { |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
650 | PurpleIMConversation *im; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
651 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
652 | im = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc)); |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
653 | if (im != NULL) { |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
654 | purple_im_conversation_set_typing_state(im, state); |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12677
diff
changeset
|
655 | } else { |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
656 | switch (state) |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12677
diff
changeset
|
657 | { |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
658 | case PURPLE_IM_TYPING: |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
659 | purple_signal_emit(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
660 | "buddy-typing", purple_connection_get_account(gc), name); |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
661 | break; |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
662 | case PURPLE_IM_TYPED: |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
663 | purple_signal_emit(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
664 | "buddy-typed", purple_connection_get_account(gc), name); |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
665 | break; |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
666 | case PURPLE_IM_NOT_TYPING: |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
667 | purple_signal_emit(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
668 | "buddy-typing-stopped", purple_connection_get_account(gc), name); |
|
17107
fbdf9f73f9f8
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evands@pidgin.im>
parents:
16863
diff
changeset
|
669 | break; |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12677
diff
changeset
|
670 | } |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11643
diff
changeset
|
671 | } |
|
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11643
diff
changeset
|
672 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
673 | if (im != NULL && timeout > 0) |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
674 | purple_im_conversation_start_typing_timeout(im, timeout); |
| 2993 | 675 | } |
| 1 | 676 | |
| 15884 | 677 | void serv_got_typing_stopped(PurpleConnection *gc, const char *name) { |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
678 | |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
679 | PurpleIMConversation *im; |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
680 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
681 | im = purple_conversations_find_im_with_account(name, purple_connection_get_account(gc)); |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
682 | if (im != NULL) |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11643
diff
changeset
|
683 | { |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
684 | if (purple_im_conversation_get_typing_state(im) == PURPLE_IM_NOT_TYPING) |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11643
diff
changeset
|
685 | return; |
|
5032
2276c67b0243
[gaim-migrate @ 5375]
Christian Hammond <chipx86@chipx86.com>
parents:
5024
diff
changeset
|
686 | |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
687 | purple_im_conversation_stop_typing_timeout(im); |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
688 | purple_im_conversation_set_typing_state(im, PURPLE_IM_NOT_TYPING); |
|
11706
e45dd5c7b259
[gaim-migrate @ 13997]
Richard Laager <rlaager@pidgin.im>
parents:
11643
diff
changeset
|
689 | } |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13791
diff
changeset
|
690 | else |
|
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13791
diff
changeset
|
691 | { |
| 15884 | 692 | purple_signal_emit(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
693 | "buddy-typing-stopped", purple_connection_get_account(gc), name); |
|
13844
835b8f7b3d1d
[gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents:
13791
diff
changeset
|
694 | } |
| 2993 | 695 | } |
| 1 | 696 | |
| 4487 | 697 | struct chat_invite_data { |
| 15884 | 698 | PurpleConnection *gc; |
| 5234 | 699 | GHashTable *components; |
| 4487 | 700 | }; |
| 1723 | 701 | |
| 4487 | 702 | static void chat_invite_data_free(struct chat_invite_data *cid) |
| 1 | 703 | { |
| 5234 | 704 | if (cid->components) |
| 705 | g_hash_table_destroy(cid->components); | |
| 4487 | 706 | g_free(cid); |
| 707 | } | |
| 1723 | 708 | |
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
709 | |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
710 | static void chat_invite_reject(struct chat_invite_data *cid) |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
711 | { |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
712 | serv_reject_chat(cid->gc, cid->components); |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
713 | chat_invite_data_free(cid); |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
714 | } |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
715 | |
|
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
716 | |
| 4487 | 717 | static void chat_invite_accept(struct chat_invite_data *cid) |
| 718 | { | |
| 5234 | 719 | serv_join_chat(cid->gc, cid->components); |
| 4487 | 720 | chat_invite_data_free(cid); |
| 1 | 721 | } |
| 722 | ||
| 723 | ||
| 724 | ||
| 15884 | 725 | void serv_got_chat_invite(PurpleConnection *gc, const char *name, |
|
5630
a05d97d87690
[gaim-migrate @ 6037]
Mark Doliner <markdoliner@pidgin.im>
parents:
5602
diff
changeset
|
726 | const char *who, const char *message, GHashTable *data) |
| 1 | 727 | { |
| 15884 | 728 | PurpleAccount *account; |
|
1252
94fbface2d84
[gaim-migrate @ 1262]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
729 | char buf2[BUF_LONG]; |
|
25291
52482ea6d188
Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7863.
Daniel Atallah <datallah@pidgin.im>
parents:
24640
diff
changeset
|
730 | struct chat_invite_data *cid; |
| 11064 | 731 | int plugin_return; |
| 1 | 732 | |
|
28724
bbe9259aebaa
Make sure the room name and the buddy who invited you are non-null
Mark Doliner <markdoliner@pidgin.im>
parents:
28723
diff
changeset
|
733 | g_return_if_fail(name != NULL); |
|
bbe9259aebaa
Make sure the room name and the buddy who invited you are non-null
Mark Doliner <markdoliner@pidgin.im>
parents:
28723
diff
changeset
|
734 | g_return_if_fail(who != NULL); |
|
bbe9259aebaa
Make sure the room name and the buddy who invited you are non-null
Mark Doliner <markdoliner@pidgin.im>
parents:
28723
diff
changeset
|
735 | |
| 15884 | 736 | account = purple_connection_get_account(gc); |
|
34583
476c39afcaae
Refactored the libpurple core to use the GObject-based PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
32678
diff
changeset
|
737 | if (!purple_account_privacy_check(account, who)) { |
|
28723
93de66f644a9
Call purple_privacy_check() even when the protocol has some privacy
Mark Doliner <markdoliner@pidgin.im>
parents:
28578
diff
changeset
|
738 | purple_signal_emit(purple_conversations_get_handle(), "chat-invite-blocked", |
|
93de66f644a9
Call purple_privacy_check() even when the protocol has some privacy
Mark Doliner <markdoliner@pidgin.im>
parents:
28578
diff
changeset
|
739 | account, who, name, message, data); |
|
93de66f644a9
Call purple_privacy_check() even when the protocol has some privacy
Mark Doliner <markdoliner@pidgin.im>
parents:
28578
diff
changeset
|
740 | return; |
| 12849 | 741 | } |
| 1 | 742 | |
|
25291
52482ea6d188
Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7863.
Daniel Atallah <datallah@pidgin.im>
parents:
24640
diff
changeset
|
743 | cid = g_new0(struct chat_invite_data, 1); |
|
52482ea6d188
Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7863.
Daniel Atallah <datallah@pidgin.im>
parents:
24640
diff
changeset
|
744 | |
| 15884 | 745 | plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1( |
| 746 | purple_conversations_get_handle(), | |
| 11064 | 747 | "chat-invited", account, who, name, message, data)); |
| 1 | 748 | |
| 4487 | 749 | cid->gc = gc; |
| 5234 | 750 | cid->components = data; |
| 1 | 751 | |
| 11064 | 752 | if (plugin_return == 0) |
| 753 | { | |
| 754 | if (message != NULL) | |
| 755 | { | |
| 756 | g_snprintf(buf2, sizeof(buf2), | |
| 757 | _("%s has invited %s to the chat room %s:\n%s"), | |
| 15884 | 758 | who, purple_account_get_username(account), name, message); |
| 11064 | 759 | } |
| 760 | else | |
| 761 | g_snprintf(buf2, sizeof(buf2), | |
| 762 | _("%s has invited %s to the chat room %s\n"), | |
| 15884 | 763 | who, purple_account_get_username(account), name); |
| 11064 | 764 | |
| 765 | ||
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
766 | purple_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2, |
|
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
|
767 | PURPLE_DEFAULT_ACTION_NONE, account, who, NULL, |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
768 | cid, G_CALLBACK(chat_invite_accept), |
|
8562
7e73676d1772
[gaim-migrate @ 9306]
Christopher O'Brien <siege@pidgin.im>
parents:
8413
diff
changeset
|
769 | G_CALLBACK(chat_invite_reject)); |
| 11064 | 770 | } |
| 771 | else if (plugin_return > 0) | |
| 772 | chat_invite_accept(cid); | |
| 773 | else | |
| 774 | chat_invite_reject(cid); | |
| 1 | 775 | } |
| 776 | ||
|
34632
ebe6b2a60305
Changed all arguments and return types of Chat and IMs to PurpleChatConversation and PurpleIMConversation.
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
777 | PurpleChatConversation *serv_got_joined_chat(PurpleConnection *gc, |
|
5630
a05d97d87690
[gaim-migrate @ 6037]
Mark Doliner <markdoliner@pidgin.im>
parents:
5602
diff
changeset
|
778 | int id, const char *name) |
| 1 | 779 | { |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
780 | PurpleChatConversation *chat; |
| 15884 | 781 | PurpleAccount *account; |
| 1 | 782 | |
| 15884 | 783 | account = purple_connection_get_account(gc); |
| 1 | 784 | |
|
27789
5862eda3c24d
Commit the QQ null chat room name crash on the *right* branch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
785 | g_return_val_if_fail(account != NULL, NULL); |
|
5862eda3c24d
Commit the QQ null chat room name crash on the *right* branch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
786 | g_return_val_if_fail(name != NULL, NULL); |
|
5862eda3c24d
Commit the QQ null chat room name crash on the *right* branch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
787 | |
|
34632
ebe6b2a60305
Changed all arguments and return types of Chat and IMs to PurpleChatConversation and PurpleIMConversation.
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
788 | chat = purple_chat_conversation_new(account, name); |
|
ebe6b2a60305
Changed all arguments and return types of Chat and IMs to PurpleChatConversation and PurpleIMConversation.
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
789 | g_return_val_if_fail(chat != NULL, NULL); |
|
27789
5862eda3c24d
Commit the QQ null chat room name crash on the *right* branch.
Paul Aurich <darkrain42@pidgin.im>
parents:
27361
diff
changeset
|
790 | |
|
34755
9336815f86b6
Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
791 | if (!g_slist_find(purple_connection_get_active_chats(gc), chat)) |
|
9336815f86b6
Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
792 | _purple_connection_add_active_chat(gc, chat); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
793 | |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
794 | purple_chat_conversation_set_id(chat, id); |
|
4476
bf88170ba269
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4440
diff
changeset
|
795 | |
|
34632
ebe6b2a60305
Changed all arguments and return types of Chat and IMs to PurpleChatConversation and PurpleIMConversation.
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
796 | purple_signal_emit(purple_conversations_get_handle(), "chat-joined", chat); |
| 3710 | 797 | |
|
34632
ebe6b2a60305
Changed all arguments and return types of Chat and IMs to PurpleChatConversation and PurpleIMConversation.
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
798 | return chat; |
| 1 | 799 | } |
| 800 | ||
| 15884 | 801 | void serv_got_chat_left(PurpleConnection *g, int id) |
| 1 | 802 | { |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
803 | GSList *bcs; |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
804 | PurpleChatConversation *chat = NULL; |
| 1 | 805 | |
|
34755
9336815f86b6
Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
806 | for (bcs = purple_connection_get_active_chats(g); bcs != NULL; bcs = bcs->next) { |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
807 | chat = PURPLE_CHAT_CONVERSATION(bcs->data); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
808 | |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
809 | if (purple_chat_conversation_get_id(chat) == id) |
|
1252
94fbface2d84
[gaim-migrate @ 1262]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
810 | break; |
|
94fbface2d84
[gaim-migrate @ 1262]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
811 | } |
| 1 | 812 | |
| 15884 | 813 | purple_debug(PURPLE_DEBUG_INFO, "server", "Leaving room: %s\n", |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
814 | purple_conversation_get_name(PURPLE_CONVERSATION(chat))); |
| 1 | 815 | |
|
34755
9336815f86b6
Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
816 | _purple_connection_remove_active_chat(g, chat); |
| 1 | 817 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
818 | purple_chat_conversation_leave(chat); |
|
12797
d0f51cfde6bc
[gaim-migrate @ 15144]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12677
diff
changeset
|
819 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
820 | purple_signal_emit(purple_conversations_get_handle(), "chat-left", chat); |
| 1 | 821 | } |
| 822 | ||
|
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
|
823 | void purple_serv_got_join_chat_failed(PurpleConnection *gc, GHashTable *data) |
|
22920
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22919
diff
changeset
|
824 | { |
|
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22919
diff
changeset
|
825 | purple_signal_emit(purple_conversations_get_handle(), "chat-join-failed", |
|
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
|
826 | gc, data); |
|
22920
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22919
diff
changeset
|
827 | } |
|
6681f6f71dfc
applied changes from feb2303b4209e0eeb4e20beaf151b1e4368c4e03
Evan Schoenberg <evands@pidgin.im>
parents:
22919
diff
changeset
|
828 | |
| 15884 | 829 | void serv_got_chat_in(PurpleConnection *g, int id, const char *who, |
| 830 | PurpleMessageFlags flags, const char *message, time_t mtime) | |
| 1 | 831 | { |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
832 | GSList *bcs; |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
833 | PurpleChatConversation *chat = NULL; |
| 3163 | 834 | char *buffy, *angel; |
| 835 | int plugin_return; | |
| 1 | 836 | |
|
12894
acc0a48a8dc8
[gaim-migrate @ 15247]
Christopher O'Brien <siege@pidgin.im>
parents:
12849
diff
changeset
|
837 | g_return_if_fail(who != NULL); |
|
acc0a48a8dc8
[gaim-migrate @ 15247]
Christopher O'Brien <siege@pidgin.im>
parents:
12849
diff
changeset
|
838 | g_return_if_fail(message != NULL); |
|
acc0a48a8dc8
[gaim-migrate @ 15247]
Christopher O'Brien <siege@pidgin.im>
parents:
12849
diff
changeset
|
839 | |
|
34755
9336815f86b6
Refactored the remaining libpurple to use the initial GObject connection API
Ankit Vani <a@nevitus.org>
parents:
34746
diff
changeset
|
840 | for (bcs = purple_connection_get_active_chats(g); bcs != NULL; bcs = bcs->next) { |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
841 | chat = PURPLE_CHAT_CONVERSATION(bcs->data); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
842 | |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
843 | if (purple_chat_conversation_get_id(chat) == id) |
|
1252
94fbface2d84
[gaim-migrate @ 1262]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
844 | break; |
|
94fbface2d84
[gaim-migrate @ 1262]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1250
diff
changeset
|
845 | } |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
846 | |
|
25721
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
847 | /* Did I send the message? */ |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
34583
diff
changeset
|
848 | if (purple_strequal(purple_chat_conversation_get_nick(chat), |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
849 | purple_normalize(purple_conversation_get_account( |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
850 | PURPLE_CONVERSATION(chat)), who))) { |
|
25721
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
851 | flags |= PURPLE_MESSAGE_SEND; |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
852 | flags &= ~PURPLE_MESSAGE_RECV; /* Just in case some prpl sets it! */ |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
853 | } else { |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
854 | flags |= PURPLE_MESSAGE_RECV; |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
855 | } |
|
d49e93a18899
*** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25291
diff
changeset
|
856 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
857 | /* |
|
20641
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
858 | * Make copies of the message and the sender in case plugins want |
|
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
859 | * to free these strings and replace them with a modifed version. |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
860 | */ |
|
20641
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
861 | buffy = g_strdup(message); |
| 3163 | 862 | angel = g_strdup(who); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
863 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6479
diff
changeset
|
864 | plugin_return = GPOINTER_TO_INT( |
| 15884 | 865 | purple_signal_emit_return_1(purple_conversations_get_handle(), |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
866 | "receiving-chat-msg", purple_connection_get_account(g), |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
867 | &angel, &buffy, chat, &flags)); |
| 3163 | 868 | |
| 869 | if (!buffy || !angel || plugin_return) { | |
|
12894
acc0a48a8dc8
[gaim-migrate @ 15247]
Christopher O'Brien <siege@pidgin.im>
parents:
12849
diff
changeset
|
870 | g_free(buffy); |
|
acc0a48a8dc8
[gaim-migrate @ 15247]
Christopher O'Brien <siege@pidgin.im>
parents:
12849
diff
changeset
|
871 | g_free(angel); |
|
2372
c24942700dfd
[gaim-migrate @ 2385]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2359
diff
changeset
|
872 | return; |
| 3163 | 873 | } |
|
20641
bb5367e64507
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <markdoliner@pidgin.im>
parents:
20080
diff
changeset
|
874 | |
| 3163 | 875 | who = angel; |
| 876 | message = buffy; | |
| 1 | 877 | |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32614
diff
changeset
|
878 | purple_signal_emit(purple_conversations_get_handle(), "received-chat-msg", purple_connection_get_account(g), |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
879 | who, message, chat, flags); |
| 8999 | 880 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34632
diff
changeset
|
881 | purple_conversation_write_message(PURPLE_CONVERSATION(chat), who, message, flags, mtime); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4349
diff
changeset
|
882 | |
| 6350 | 883 | g_free(angel); |
|
6062
a292fd631fdb
[gaim-migrate @ 6512]
Mark Doliner <markdoliner@pidgin.im>
parents:
6059
diff
changeset
|
884 | g_free(buffy); |
| 1 | 885 | } |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9453
diff
changeset
|
886 | |
| 15884 | 887 | void serv_send_file(PurpleConnection *gc, const char *who, const char *file) |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9453
diff
changeset
|
888 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
889 | PurpleProtocol *protocol; |
|
10751
e15f4f5927ce
[gaim-migrate @ 12354]
Mark Doliner <markdoliner@pidgin.im>
parents:
10745
diff
changeset
|
890 | |
|
28578
74b2a6dba113
Change the way we handle these if checks to hopefully be a little
Mark Doliner <markdoliner@pidgin.im>
parents:
28577
diff
changeset
|
891 | if (gc) { |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
892 | protocol = purple_connection_get_protocol(gc); |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9453
diff
changeset
|
893 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
894 | if (protocol->send_file && |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
895 | (!protocol->can_receive_file |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
896 | || purple_protocol_iface_can_receive_file(protocol, gc, who))) |
|
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
897 | purple_protocol_iface_send_file(protocol, gc, who, file); |
|
9647
7ae5b5933b5a
[gaim-migrate @ 10495]
Daniel Atallah <datallah@pidgin.im>
parents:
9620
diff
changeset
|
898 | } |
|
9466
b6425eab60ca
[gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents:
9453
diff
changeset
|
899 | } |