Mercurial > pidgin
annotate src/protocols/msn/session.h @ 5867:db4df0be06fd
[gaim-migrate @ 6298]
Added a little bit of code to prevent duplicate accounts, but it doesn't
fix the problem of importing all new accounts when are importing from the
old .gaimrc and also have an accounts.xml already established.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 14 Jun 2003 12:01:19 +0000 |
| parents | 187c740f2a4e |
| children | 5baeb89ee2d4 |
| rev | line source |
|---|---|
| 5309 | 1 /** |
| 2 * @file session.h MSN session functions | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
| 6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
| 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 | |
| 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 | |
| 27 #include "servconn.h" | |
| 28 #include "switchboard.h" | |
| 29 #include "user.h" | |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
30 #include "group.h" |
| 5309 | 31 |
| 32 struct _MsnSession | |
| 33 { | |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
34 GaimAccount *account; |
|
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
35 MsnUser *user; |
| 5309 | 36 |
| 37 char *dispatch_server; | |
| 38 int dispatch_port; | |
| 39 | |
| 40 gboolean connected; | |
| 41 | |
| 42 MsnServConn *dispatch_conn; | |
| 43 MsnServConn *notification_conn; | |
| 44 | |
| 45 unsigned int trId; | |
| 46 | |
| 47 MsnUsers *users; | |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
48 MsnGroups *groups; |
| 5309 | 49 |
| 50 GList *switches; | |
| 51 | |
| 52 struct | |
| 53 { | |
| 54 GSList *forward; | |
| 55 GSList *reverse; | |
| 56 GSList *allow; | |
| 57 GSList *block; | |
| 58 | |
| 59 } lists; | |
| 60 | |
| 61 struct | |
| 62 { | |
| 63 char *kv; | |
| 64 char *sid; | |
| 65 char *mspauth; | |
| 66 unsigned long sl; | |
| 67 char *file; | |
| 68 | |
| 69 } passport_info; | |
| 70 | |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
71 /* You have no idea how much I hate all that is below. */ |
| 5309 | 72 GaimPlugin *prpl; |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
73 |
|
5456
40e976d42028
[gaim-migrate @ 5844]
Christian Hammond <chipx86@chipx86.com>
parents:
5406
diff
changeset
|
74 gboolean syncing_lists; |
|
5406
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
75 gboolean lists_synced; |
|
9acf4832c0dc
[gaim-migrate @ 5782]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
76 |
|
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
77 /* For moving buddies from one group to another. Ugh. */ |
|
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
78 gboolean moving_buddy; |
|
5327
b716ffc25d2d
[gaim-migrate @ 5700]
Christian Hammond <chipx86@chipx86.com>
parents:
5322
diff
changeset
|
79 char *dest_group_name; |
|
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
80 MsnUser *moving_user; |
|
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5456
diff
changeset
|
81 MsnGroup *old_group; |
| 5309 | 82 }; |
| 83 | |
| 84 /** | |
| 85 * Creates an MSN session. | |
| 86 * | |
| 87 * @param account The account. | |
| 88 * @param server The dispatch server. | |
| 89 * @param port The dispatch port. | |
| 90 * | |
| 91 * @return The new MSN session. | |
| 92 */ | |
|
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
93 MsnSession *msn_session_new(GaimAccount *account, |
| 5309 | 94 const char *server, int port); |
| 95 | |
| 96 /** | |
| 97 * Destroys an MSN session. | |
| 98 * | |
| 99 * @param session The MSN session to destroy. | |
| 100 */ | |
| 101 void msn_session_destroy(MsnSession *session); | |
| 102 | |
| 103 /** | |
| 104 * Connects to and initiates an MSN session. | |
| 105 * | |
| 106 * @param session The MSN session. | |
| 107 * | |
| 108 * @return @c TRUE on success, @c FALSE on failure. | |
| 109 */ | |
| 110 gboolean msn_session_connect(MsnSession *session); | |
| 111 | |
| 112 /** | |
| 113 * Disconnects from an MSN session. | |
| 114 * | |
| 115 * @param session The MSN session. | |
| 116 */ | |
| 117 void msn_session_disconnect(MsnSession *session); | |
| 118 | |
| 119 /** | |
| 120 * Opens a new switchboard connection. | |
| 121 * | |
| 122 * @param session The MSN session. | |
| 123 * | |
| 124 * @return The new switchboard connection. | |
| 125 */ | |
| 126 MsnSwitchBoard *msn_session_open_switchboard(MsnSession *session); | |
| 127 | |
| 128 /** | |
| 129 * Finds a switch with the given passport. | |
| 130 * | |
| 131 * @param session The MSN session. | |
| 132 * @param passport The passport to search for. | |
| 133 * | |
| 134 * @return The switchboard, if found. | |
| 135 */ | |
| 136 MsnSwitchBoard *msn_session_find_switch_with_passport( | |
| 137 const MsnSession *session, const char *passport); | |
| 138 | |
| 139 /** | |
| 140 * Finds a switchboard with the given chat ID. | |
| 141 * | |
| 142 * @param session The MSN session. | |
| 143 * @param chat_id The chat ID to search for. | |
| 144 * | |
| 145 * @return The switchboard, if found. | |
| 146 */ | |
| 147 MsnSwitchBoard *msn_session_find_switch_with_id(const MsnSession *session, | |
| 148 int chat_id); | |
| 149 | |
| 150 /** | |
| 151 * Finds the first unused switchboard. | |
| 152 * | |
| 153 * @param session The MSN session. | |
| 154 * | |
| 155 * @return The first unused, writable switchboard, if found. | |
| 156 */ | |
| 157 MsnSwitchBoard *msn_session_find_unused_switch(const MsnSession *session); | |
| 158 | |
| 159 #endif /* _MSN_SESSION_H_ */ |
