| 2708 /* Setup a callback, to be called when a reply is received with the returned rid. |
2708 /* Setup a callback, to be called when a reply is received with the returned rid. |
| 2709 * |
2709 * |
| 2710 * @param cb The callback, an MSIM_USER_LOOKUP_CB. |
2710 * @param cb The callback, an MSIM_USER_LOOKUP_CB. |
| 2711 * @param data Arbitrary user data to be passed to callback (probably an MsimMessage *). |
2711 * @param data Arbitrary user data to be passed to callback (probably an MsimMessage *). |
| 2712 * |
2712 * |
| 2713 * @return The request/reply ID, used to link replies with requests. Put the rid in your request. |
2713 * @return The request/reply ID, used to link replies with requests, or -1. |
| |
2714 * Put the rid in your request, 'rid' field. |
| 2714 * |
2715 * |
| 2715 * TODO: Make more generic and more specific: |
2716 * TODO: Make more generic and more specific: |
| 2716 * 1) MSIM_USER_LOOKUP_CB - make it for PERSIST_REPLY, not just user lookup |
2717 * 1) MSIM_USER_LOOKUP_CB - make it for PERSIST_REPLY, not just user lookup |
| 2717 * 2) data - make it an MsimMessage? |
2718 * 2) data - make it an MsimMessage? |
| 2718 */ |
2719 */ |
| 2719 guint |
2720 guint |
| 2720 msim_new_reply_callback(MsimSession *session, MSIM_USER_LOOKUP_CB cb, |
2721 msim_new_reply_callback(MsimSession *session, MSIM_USER_LOOKUP_CB cb, |
| 2721 gpointer data) |
2722 gpointer data) |
| 2722 { |
2723 { |
| 2723 guint rid; |
2724 guint rid; |
| |
2725 |
| |
2726 g_return_val_if_fail(MSIM_SESSION_VALID(session), -1); |
| 2724 |
2727 |
| 2725 rid = session->next_rid++; |
2728 rid = session->next_rid++; |
| 2726 |
2729 |
| 2727 g_hash_table_insert(session->user_lookup_cb, GUINT_TO_POINTER(rid), cb); |
2730 g_hash_table_insert(session->user_lookup_cb, GUINT_TO_POINTER(rid), cb); |
| 2728 g_hash_table_insert(session->user_lookup_cb_data, GUINT_TO_POINTER(rid), data); |
2731 g_hash_table_insert(session->user_lookup_cb_data, GUINT_TO_POINTER(rid), data); |
| 3162 NULL, /**< dependencies */ |
3165 NULL, /**< dependencies */ |
| 3163 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
3166 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 3164 |
3167 |
| 3165 "prpl-myspace", /**< id */ |
3168 "prpl-myspace", /**< id */ |
| 3166 "MySpaceIM", /**< name */ |
3169 "MySpaceIM", /**< name */ |
| 3167 "0.10", /**< version */ |
3170 "0.12", /**< version */ |
| 3168 /** summary */ |
3171 /** summary */ |
| 3169 "MySpaceIM Protocol Plugin", |
3172 "MySpaceIM Protocol Plugin", |
| 3170 /** description */ |
3173 /** description */ |
| 3171 "MySpaceIM Protocol Plugin", |
3174 "MySpaceIM Protocol Plugin", |
| 3172 "Jeff Connelly <jeff2@soc.pidgin.im>", /**< author */ |
3175 "Jeff Connelly <jeff2@soc.pidgin.im>", /**< author */ |