libpurple/protocols/yahoo/libymsg.c

branch
next.minor
changeset 29514
7b39d4c94f2e
parent 29504
33c77abe6147
parent 28539
035a20f78921
child 29519
3a00ddd41916
equal deleted inserted replaced
29513:8a5b7bca32a5 29514:7b39d4c94f2e
218 f->away = 0; 218 f->away = 0;
219 219
220 if (f->status == YAHOO_STATUS_IDLE) { 220 if (f->status == YAHOO_STATUS_IDLE) {
221 /* Idle may have already been set in a more precise way in case 137 */ 221 /* Idle may have already been set in a more precise way in case 137 */
222 if (f->idle == 0) 222 if (f->idle == 0)
223 f->idle = time(NULL); 223 {
224 if(pkt->service == YAHOO_SERVICE_STATUS_15)
225 f->idle = -1;
226 else
227 f->idle = time(NULL);
228 }
224 } else 229 } else
225 f->idle = 0; 230 f->idle = 0;
226 231
227 if (f->status != YAHOO_STATUS_CUSTOM) 232 if (f->status != YAHOO_STATUS_CUSTOM)
228 yahoo_friend_set_status_message(f, NULL); 233 yahoo_friend_set_status_message(f, NULL);
251 256
252 f->away = strtol(pair->value, NULL, 10); 257 f->away = strtol(pair->value, NULL, 10);
253 if (f->away == 2) { 258 if (f->away == 2) {
254 /* Idle may have already been set in a more precise way in case 137 */ 259 /* Idle may have already been set in a more precise way in case 137 */
255 if (f->idle == 0) 260 if (f->idle == 0)
256 f->idle = time(NULL); 261 {
262 if(pkt->service == YAHOO_SERVICE_STATUS_15)
263 f->idle = -1;
264 else
265 f->idle = time(NULL);
266 }
257 } 267 }
258 268
259 break; 269 break;
260 case 138: /* either we're not idle, or we are but won't say how long */ 270 case 138: /* when value is 1, either we're not idle, or we are but won't say how long */
261 if (!f) 271 if (!f)
262 break; 272 break;
263 273
264 if (f->idle) 274 if( (strtol(pair->value, NULL, 10) == 1) && (f->idle) )
265 f->idle = -1; 275 f->idle = -1;
266 break; 276 break;
267 case 137: /* usually idle time in seconds, sometimes login time */ 277 case 137: /* usually idle time in seconds, sometimes login time */
268 if (!f) 278 if (!f)
269 break; 279 break;
2007 G_CALLBACK(ignore_buddy), 2017 G_CALLBACK(ignore_buddy),
2008 G_CALLBACK(keep_buddy)); 2018 G_CALLBACK(keep_buddy));
2009 break; 2019 break;
2010 } 2020 }
2011 case 2: 2021 case 2:
2012 purple_debug_info("yahoo", "Server reported that %s is already in the ignore list.", 2022 purple_debug_info("yahoo", "Server reported that %s is already in the ignore list.\n",
2013 who); 2023 who);
2014 break; 2024 break;
2015 case 3: 2025 case 3:
2016 purple_debug_info("yahoo", "Server reported that %s is not in the ignore list; could not delete", 2026 purple_debug_info("yahoo", "Server reported that %s is not in the ignore list; could not delete\n",
2017 who); 2027 who);
2018 case 0: 2028 case 0:
2019 default: 2029 default:
2020 break; 2030 break;
2021 } 2031 }
2087 msg = g_strdup_printf(_("Unknown error 52. Reconnecting should fix this.")); 2097 msg = g_strdup_printf(_("Unknown error 52. Reconnecting should fix this."));
2088 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; 2098 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
2089 break; 2099 break;
2090 case 1013: 2100 case 1013:
2091 msg = g_strdup(_("Error 1013: The username you have entered is invalid." 2101 msg = g_strdup(_("Error 1013: The username you have entered is invalid."
2092 " The most common cause of this error is entering your e-mail" 2102 " The most common cause of this error is entering your email"
2093 " address instead of your Yahoo! ID.")); 2103 " address instead of your Yahoo! ID."));
2094 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; 2104 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME;
2095 break; 2105 break;
2096 default: 2106 default:
2097 msg = g_strdup_printf(_("Unknown error number %d. Logging into the Yahoo! website may fix this."), err); 2107 msg = g_strdup_printf(_("Unknown error number %d. Logging into the Yahoo! website may fix this."), err);
4492 4502
4493 g_free(conv_msg); 4503 g_free(conv_msg);
4494 4504
4495 if (purple_presence_is_idle(presence)) 4505 if (purple_presence_is_idle(presence))
4496 yahoo_packet_hash_str(pkt, 47, "2"); 4506 yahoo_packet_hash_str(pkt, 47, "2");
4507 else {
4508 if (!purple_status_is_available(status))
4509 yahoo_packet_hash_str(pkt, 47, "1");
4510 else
4511 yahoo_packet_hash_str(pkt, 47, "0");
4512 }
4497 4513
4498 yahoo_packet_send_and_free(pkt, yd); 4514 yahoo_packet_send_and_free(pkt, yd);
4499 4515
4500 if (old_status == YAHOO_STATUS_INVISIBLE) { 4516 if (old_status == YAHOO_STATUS_INVISIBLE) {
4501 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE, YAHOO_STATUS_AVAILABLE, yd->session_id); 4517 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE, YAHOO_STATUS_AVAILABLE, yd->session_id);

mercurial