Fri, 21 May 2004 14:33:32 +0000
[gaim-migrate @ 9774]
" This patch renames the existing received-*-msg signals
to receiving-*msg to fit the naming of other signals
where a pointer to the message is passed (writing,
sending, displaying)
It adds new received-*-msg signals which are emitted
after the receiving signals, in line with the other
conversation signals (wrote, sent, displayed)
This is necessary to allow plugins which depend on the
final received message to work alongside plugins which
may modify the message.
One known example of this is festival-gaim alongside
gaim-encryption - festival-gaim would try to "speak"
the encrypted text:
http://sf.net/tracker/?func=detail&aid=943216&group_id=89763&atid=591320
I've tested this with gaim-encryption and festival-gaim
(locally modified so gaim-encryption uses the receiving
signal and festival uses the received signal)
All in-tree users of received-*-msg are updated to use
receiving-*-msg if they do modify the message, the
conversation-signals documentation is updated, the
signals-test.c & signal-test.tcl plugins are also updated." --Stu Tomlinson
committer: Luke Schierer <lschiere@pidgin.im>
| 5309 | 1 | /** |
| 2 | * @file session.h MSN session functions | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
|
8475
3b5687726055
[gaim-migrate @ 9208]
Christian Hammond <chipx86@chipx86.com>
parents:
8298
diff
changeset
|
6 | * Copyright (C) 2003-2004 Christian Hammond <chipx86@gnupdate.org> |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
7 | * |
| 5309 | 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 | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | */ | |
| 22 | #ifndef _MSN_SESSION_H_ | |
| 23 | #define _MSN_SESSION_H_ | |
| 24 | ||
| 25 | typedef struct _MsnSession MsnSession; | |
| 26 | ||
|
8171
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
27 | #include "group.h" |
|
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
28 | #include "nexus.h" |
|
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
29 | #include "servconn.h" |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
30 | #include "sslconn.h" |
| 5309 | 31 | #include "switchboard.h" |
| 32 | #include "user.h" | |
|
8171
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
33 | |
| 5309 | 34 | |
| 35 | struct _MsnSession | |
| 36 | { | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
37 | GaimAccount *account; |
|
5363
b6e28be0c9bd
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
38 | MsnUser *user; |
|
7590
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
39 | char *away_state; |
| 5309 | 40 | |
| 7631 | 41 | guint protocol_ver; |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
42 | |
| 5309 | 43 | char *dispatch_server; |
| 44 | int dispatch_port; | |
| 45 | ||
| 46 | gboolean connected; | |
| 47 | ||
| 48 | MsnServConn *notification_conn; | |
| 49 | ||
|
8171
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
50 | MsnNexus *nexus; |
|
c3c43a25caec
[gaim-migrate @ 8884]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7631
diff
changeset
|
51 | |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
52 | gboolean http_method; |
|
8298
eb6f1096ffa6
[gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents:
8171
diff
changeset
|
53 | gint http_poll_timer; |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
54 | |
| 5309 | 55 | MsnUsers *users; |
|
5518
436fb9490b62
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
56 | MsnGroups *groups; |
| 5309 | 57 | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
58 | int servconns_count; |
|
5898
77c591517706
[gaim-migrate @ 6330]
Christian Hammond <chipx86@chipx86.com>
parents:
5564
diff
changeset
|
59 | GList *servconns; |
| 5309 | 60 | GList *switches; |
| 61 | ||
| 62 | struct | |
| 63 | { | |
| 64 | GSList *forward; | |
| 65 | GSList *reverse; | |
| 66 | GSList *allow; | |
| 67 | GSList *block; | |
| 68 | ||
| 69 | } lists; | |
| 70 | ||
| 71 | struct | |
| 72 | { | |
| 73 | char *kv; | |
| 74 | char *sid; | |
| 75 | char *mspauth; | |
| 76 | unsigned long sl; | |
| 77 | char *file; | |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
78 | char *client_ip; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
79 | int client_port; |
| 5309 | 80 | |
| 81 | } passport_info; | |
| 82 | ||
|
5322
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
83 | /* You have no idea how much I hate all that is below. */ |
| 5309 | 84 | GaimPlugin *prpl; |
|
5322
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
85 | |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
86 | /* For MSNP8 and MSNP9. */ |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
87 | int num_users; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
88 | int total_users; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
89 | int num_groups; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
90 | int total_groups; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
91 | MsnUser *last_user_added; |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
92 | |
|
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5898
diff
changeset
|
93 | /* For MSNP7 and lower. */ |
|
5456
ff4eb9f08890
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
94 | gboolean syncing_lists; |
|
5406
001d8ddda70b
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
95 | gboolean lists_synced; |
|
001d8ddda70b
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
96 | |
|
5322
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
97 | /* For moving buddies from one group to another. Ugh. */ |
|
782746a9bfdd
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
98 | gboolean moving_buddy; |
|
5327
c12297f29f8d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5322
diff
changeset
|
99 | char *dest_group_name; |
|
5518
436fb9490b62
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
100 | MsnUser *moving_user; |
|
436fb9490b62
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
101 | MsnGroup *old_group; |
| 8499 | 102 | |
| 103 | /* The last chat ID. */ | |
| 104 | int last_chat_id; | |
| 5309 | 105 | }; |
| 106 | ||
| 107 | /** | |
| 108 | * Creates an MSN session. | |
| 109 | * | |
| 110 | * @param account The account. | |
| 111 | * @param server The dispatch server. | |
| 112 | * @param port The dispatch port. | |
| 113 | * | |
| 114 | * @return The new MSN session. | |
| 115 | */ | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
116 | MsnSession *msn_session_new(GaimAccount *account, |
| 5309 | 117 | const char *server, int port); |
| 118 | ||
| 119 | /** | |
| 120 | * Destroys an MSN session. | |
| 121 | * | |
| 122 | * @param session The MSN session to destroy. | |
| 123 | */ | |
| 124 | void msn_session_destroy(MsnSession *session); | |
| 125 | ||
| 126 | /** | |
| 127 | * Connects to and initiates an MSN session. | |
| 128 | * | |
| 129 | * @param session The MSN session. | |
| 130 | * | |
| 131 | * @return @c TRUE on success, @c FALSE on failure. | |
| 132 | */ | |
| 133 | gboolean msn_session_connect(MsnSession *session); | |
| 134 | ||
| 135 | /** | |
| 136 | * Disconnects from an MSN session. | |
| 137 | * | |
| 138 | * @param session The MSN session. | |
| 139 | */ | |
| 140 | void msn_session_disconnect(MsnSession *session); | |
| 141 | ||
| 142 | /** | |
| 143 | * Opens a new switchboard connection. | |
| 144 | * | |
| 145 | * @param session The MSN session. | |
| 146 | * | |
| 147 | * @return The new switchboard connection. | |
| 148 | */ | |
| 149 | MsnSwitchBoard *msn_session_open_switchboard(MsnSession *session); | |
| 150 | ||
| 151 | /** | |
|
7590
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
152 | * Changes the status of the user. |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
153 | * |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
154 | * @param session The MSN session. |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
155 | * @param state The new state. |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
156 | */ |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
157 | gboolean msn_session_change_status(MsnSession *session, const char *state); |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
158 | |
|
54b26062c7e0
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7288
diff
changeset
|
159 | /** |
| 5309 | 160 | * Finds a switch with the given passport. |
| 161 | * | |
| 162 | * @param session The MSN session. | |
| 163 | * @param passport The passport to search for. | |
| 164 | * | |
| 165 | * @return The switchboard, if found. | |
| 166 | */ | |
| 167 | MsnSwitchBoard *msn_session_find_switch_with_passport( | |
| 168 | const MsnSession *session, const char *passport); | |
| 169 | ||
| 170 | /** | |
| 171 | * Finds a switchboard with the given chat ID. | |
| 172 | * | |
| 173 | * @param session The MSN session. | |
| 174 | * @param chat_id The chat ID to search for. | |
| 175 | * | |
| 176 | * @return The switchboard, if found. | |
| 177 | */ | |
| 178 | MsnSwitchBoard *msn_session_find_switch_with_id(const MsnSession *session, | |
| 179 | int chat_id); | |
| 180 | ||
| 181 | /** | |
| 182 | * Finds the first unused switchboard. | |
| 183 | * | |
| 184 | * @param session The MSN session. | |
| 185 | * | |
| 186 | * @return The first unused, writable switchboard, if found. | |
| 187 | */ | |
| 188 | MsnSwitchBoard *msn_session_find_unused_switch(const MsnSession *session); | |
| 189 | ||
| 190 | #endif /* _MSN_SESSION_H_ */ |