| 114 memcpy(&sid, lsid.id, sizeof(uint64_t)); |
114 memcpy(&sid, lsid.id, sizeof(uint64_t)); |
| 115 |
115 |
| 116 return sid; |
116 return sid; |
| 117 } |
117 } |
| 118 |
118 |
| 119 static gg_multilogon_id_t |
119 static void |
| 120 ggp_multilogon_sid_to_libgadu(uint64_t sid) |
120 ggp_multilogon_sid_to_libgadu(uint64_t sid, gg_multilogon_id_t *lsid) |
| 121 { |
121 { |
| 122 gg_multilogon_id_t lsid; |
122 g_return_if_fail(lsid != NULL); |
| 123 |
123 |
| 124 memcpy(lsid.id, &sid, sizeof(uint64_t)); |
124 memcpy(lsid->id, &sid, sizeof(uint64_t)); |
| 125 |
|
| 126 return lsid; |
|
| 127 } |
125 } |
| 128 |
126 |
| 129 static void |
127 static void |
| 130 ggp_multilogon_fill_sessions(PurpleRequestDatasheet *sheet, |
128 ggp_multilogon_fill_sessions(PurpleRequestDatasheet *sheet, |
| 131 PurpleConnection *gc) |
129 PurpleConnection *gc) |
| 188 PurpleConnection *gc = _gc; |
186 PurpleConnection *gc = _gc; |
| 189 ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
187 ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
| 190 GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
188 GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
| 191 uint64_t sid; |
189 uint64_t sid; |
| 192 gpointer key; |
190 gpointer key; |
| |
191 gg_multilogon_id_t lsid; |
| 193 |
192 |
| 194 key = purple_request_datasheet_record_get_key(rec); |
193 key = purple_request_datasheet_record_get_key(rec); |
| 195 sid = ggp_keymapper_from_key(mldata->sid_mapper, key); |
194 sid = ggp_keymapper_from_key(mldata->sid_mapper, key); |
| 196 |
195 |
| 197 gg_multilogon_disconnect(accdata->session, |
196 ggp_multilogon_sid_to_libgadu(sid, &lsid); |
| 198 ggp_multilogon_sid_to_libgadu(sid)); |
197 gg_multilogon_disconnect(accdata->session, lsid); |
| 199 |
198 |
| 200 purple_request_datasheet_record_remove( |
199 purple_request_datasheet_record_remove( |
| 201 purple_request_datasheet_record_get_datasheet(rec), key); |
200 purple_request_datasheet_record_get_datasheet(rec), key); |
| 202 } |
201 } |
| 203 |
202 |