annotate plugins/perl/common/Conversation.xs @ 10296:a7b2fd5efcf2

[gaim-migrate @ 11476] Some "random updates" updates from patch 1077274 by Felipe Contreras: "Some changes in the behaviour of slpcalls (for FT), free some unused structures and properly close switchboard connections." Looks good to me, and seems to have fixed a mysterious FT problem that I had been pretending didn't exist. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 02 Dec 2004 16:07:26 +0000
parents a66cf83552dc
children 6132e58aa618
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6591
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #include "module.h"
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversation PREFIX = gaim_conversation_
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 gaim_conversation_set_account(conv, account)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 Gaim::Account account
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 Gaim::Account
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 gaim_conversation_get_account(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 Gaim::Connection
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 gaim_conversation_get_gc(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 gaim_conversation_set_title(conv, title)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 const char *title
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 gaim_conversation_autoset_title(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 int
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 gaim_conversation_get_index(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 const char *
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 gaim_conversation_get_name(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 gaim_conversation_set_logging(conv, log)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 gboolean log
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 gboolean
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 gaim_conversation_is_logging(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 Gaim::ConvWindow
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 gaim_conversation_get_window(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 gboolean
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 is_chat(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 CODE:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 RETVAL = (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT);
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 OUTPUT:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 RETVAL
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 gboolean
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 is_im(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 CODE:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 RETVAL = (gaim_conversation_get_type(conv) == GAIM_CONV_IM);
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 OUTPUT:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 RETVAL
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 gaim_conversation_set_data(conv, key, data)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 const char *key
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 void *data
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 void *
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 gaim_conversation_get_data(conv, key)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 const char *key
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 gaim_conversation_write(conv, who, message, flags)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 const char *who
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 const char *message
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 int flags
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 CODE:
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6642
diff changeset
83 gaim_conversation_write(conv, who, message, flags, time(NULL));
6591
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 Gaim::Conversation::IM
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 gaim_conversation_get_im_data(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 Gaim::Conversation::Chat
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 gaim_conversation_get_chat_data(conv)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 Gaim::Conversation conv
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 MODULE = Gaim::Conversation PACKAGE = Gaim::Conversations PREFIX = gaim_conversations_
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 PROTOTYPES: ENABLE
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 Gaim::Conversation
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 find_with_account(name, account)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 const char *name
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 Gaim::Account account
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 CODE:
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 6982
diff changeset
102 RETVAL = gaim_find_conversation_with_account(GAIM_CONV_ANY, name, account);
6591
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 OUTPUT:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 RETVAL
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 void *
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 handle()
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 CODE:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 RETVAL = gaim_conversations_get_handle();
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 OUTPUT:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 RETVAL
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 MODULE = Gaim::Conversation PACKAGE = Gaim PREFIX = gaim_
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 PROTOTYPES: ENABLE
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 void
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 conversations()
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 PREINIT:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 GList *l;
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 PPCODE:
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 for (l = gaim_get_conversations(); l != NULL; l = l->next)
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 {
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data,
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 "Gaim::Conversation")));
d25ae4b5a204 [gaim-migrate @ 7115]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 }