- Timestamp:
- 2009-10-10T15:00:16Z (15 years ago)
- Branches:
- master
- Children:
- e71cfbc
- Parents:
- 037b66a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/libyahoo2.c
r037b66a r7ea8697 4080 4080 struct yahoo_data *yd; 4081 4081 struct yahoo_packet *pkt = NULL; 4082 int service;4082 int old_status; 4083 4083 char s[4]; 4084 4084 … … 4088 4088 yd = yid->yd; 4089 4089 4090 if (msg) { 4090 old_status = yd->current_status; 4091 4092 if (msg && strncmp(msg,"Invisible",9)) { 4091 4093 yd->current_status = YAHOO_STATUS_CUSTOM; 4092 4094 } else { … … 4094 4096 } 4095 4097 4096 if (yd->current_status == YAHOO_STATUS_AVAILABLE) 4097 service = YAHOO_SERVICE_ISBACK; 4098 else 4099 service = YAHOO_SERVICE_ISAWAY; 4098 /* Thank you libpurple :) */ 4099 if (yd->current_status == YAHOO_STATUS_INVISIBLE) { 4100 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0); 4101 yahoo_packet_hash(pkt, 13, "2"); 4102 yahoo_send_packet(yid, pkt, 0); 4103 yahoo_packet_free(pkt); 4104 4105 return; 4106 } 4107 4108 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, yd->current_status, yd->session_id); 4109 snprintf(s, sizeof(s), "%d", yd->current_status); 4110 yahoo_packet_hash(pkt, 10, s); 4100 4111 4101 if ((away == 2) && (yd->current_status == YAHOO_STATUS_AVAILABLE)) { 4102 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_BRB, yd->session_id); 4103 yahoo_packet_hash(pkt, 10, "999"); 4104 yahoo_packet_hash(pkt, 47, "2"); 4105 }else { 4106 pkt = yahoo_packet_new(service, YAHOO_STATUS_AVAILABLE, yd->session_id); 4107 snprintf(s, sizeof(s), "%d", yd->current_status); 4108 yahoo_packet_hash(pkt, 10, s); 4109 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4110 yahoo_packet_hash(pkt, 19, msg); 4111 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 4112 } else { 4113 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 4114 } 4115 4116 4117 4118 } 4112 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4113 yahoo_packet_hash(pkt, 19, msg); 4114 } else { 4115 yahoo_packet_hash(pkt, 19, ""); 4116 } 4117 4118 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 4119 4119 4120 4120 yahoo_send_packet(yid, pkt, 0); 4121 4121 yahoo_packet_free(pkt); 4122 4123 if(old_status == YAHOO_STATUS_INVISIBLE) { 4124 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0); 4125 yahoo_packet_hash(pkt, 13, "1"); 4126 yahoo_send_packet(yid, pkt, 0); 4127 yahoo_packet_free(pkt); 4128 } 4122 4129 } 4123 4130
Note: See TracChangeset
for help on using the changeset viewer.