Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/state.c @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | 44b4e8bd759b 60bc06498746 4a099e4d0d09 |
comparison
equal
deleted
inserted
replaced
15822:84b0f9b23ede | 15823:32c366eeeb99 |
---|---|
1 /** | 1 /** |
2 * @file state.c State functions and definitions | 2 * @file state.c State functions and definitions |
3 * | 3 * |
4 * gaim | 4 * purple |
5 * | 5 * |
6 * Gaim is the legal property of its developers, whose names are too numerous | 6 * Purple is the legal property of its developers, whose names are too numerous |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | 7 * to list here. Please refer to the COPYRIGHT file distributed with this |
8 * source distribution. | 8 * source distribution. |
9 * | 9 * |
10 * This program is free software; you can redistribute it and/or modify | 10 * This program is free software; you can redistribute it and/or modify |
11 * it under the terms of the GNU General Public License as published by | 11 * it under the terms of the GNU General Public License as published by |
39 }; | 39 }; |
40 | 40 |
41 void | 41 void |
42 msn_change_status(MsnSession *session) | 42 msn_change_status(MsnSession *session) |
43 { | 43 { |
44 GaimAccount *account; | 44 PurpleAccount *account; |
45 MsnCmdProc *cmdproc; | 45 MsnCmdProc *cmdproc; |
46 MsnUser *user; | 46 MsnUser *user; |
47 MsnObject *msnobj; | 47 MsnObject *msnobj; |
48 const char *state_text; | 48 const char *state_text; |
49 | 49 |
73 char *msnobj_str; | 73 char *msnobj_str; |
74 | 74 |
75 msnobj_str = msn_object_to_string(msnobj); | 75 msnobj_str = msn_object_to_string(msnobj); |
76 | 76 |
77 msn_cmdproc_send(cmdproc, "CHG", "%s %d %s", state_text, | 77 msn_cmdproc_send(cmdproc, "CHG", "%s %d %s", state_text, |
78 MSN_CLIENT_ID, gaim_url_encode(msnobj_str)); | 78 MSN_CLIENT_ID, purple_url_encode(msnobj_str)); |
79 | 79 |
80 g_free(msnobj_str); | 80 g_free(msnobj_str); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
97 | 97 |
98 return status_text[state]; | 98 return status_text[state]; |
99 } | 99 } |
100 | 100 |
101 MsnAwayType | 101 MsnAwayType |
102 msn_state_from_account(GaimAccount *account) | 102 msn_state_from_account(PurpleAccount *account) |
103 { | 103 { |
104 MsnAwayType msnstatus; | 104 MsnAwayType msnstatus; |
105 GaimPresence *presence; | 105 PurplePresence *presence; |
106 GaimStatus *status; | 106 PurpleStatus *status; |
107 const char *status_id; | 107 const char *status_id; |
108 | 108 |
109 presence = gaim_account_get_presence(account); | 109 presence = purple_account_get_presence(account); |
110 status = gaim_presence_get_active_status(presence); | 110 status = purple_presence_get_active_status(presence); |
111 status_id = gaim_status_get_id(status); | 111 status_id = purple_status_get_id(status); |
112 | 112 |
113 if (!strcmp(status_id, "away")) | 113 if (!strcmp(status_id, "away")) |
114 msnstatus = MSN_AWAY; | 114 msnstatus = MSN_AWAY; |
115 else if (!strcmp(status_id, "brb")) | 115 else if (!strcmp(status_id, "brb")) |
116 msnstatus = MSN_BRB; | 116 msnstatus = MSN_BRB; |
123 else if (!strcmp(status_id, "invisible")) | 123 else if (!strcmp(status_id, "invisible")) |
124 msnstatus = MSN_HIDDEN; | 124 msnstatus = MSN_HIDDEN; |
125 else | 125 else |
126 msnstatus = MSN_ONLINE; | 126 msnstatus = MSN_ONLINE; |
127 | 127 |
128 if ((msnstatus == MSN_ONLINE) && gaim_presence_is_idle(presence)) | 128 if ((msnstatus == MSN_ONLINE) && purple_presence_is_idle(presence)) |
129 msnstatus = MSN_IDLE; | 129 msnstatus = MSN_IDLE; |
130 | 130 |
131 return msnstatus; | 131 return msnstatus; |
132 } | 132 } |