1. Poprawienie sposobu wysyłania obrazka przez metodę putImage klasy BotAPIGG.
2. Nie wysyłanie nagłówka przy braku formatowania.
| | |
| | | } |
| | | |
| | | function putImage($path) { |
| | | $fp = fopen($path, 'r'); |
| | | if(!$fp) { |
| | | return FALSE; |
| | | } |
| | | |
| | | $auth = $this->APIs['Gadu-Gadu']; |
| | | $token = $this->getToken(); |
| | | |
| | | $tok = $this->httpQuery('https://botapi.gadu-gadu.pl/botmaster/putImage/'.$auth['numer'], array( |
| | | CURLOPT_HTTPHEADER => array('Content-Type: image/x-any'), |
| | | CURLOPT_POST => TRUE, |
| | | CURLOPT_INFILE => $fp, |
| | | CURLOPT_POSTFIELDS => file_get_contents($path), |
| | | )); |
| | | |
| | | if( (string)$tok->status != '0') { |
| | |
| | | * @return string |
| | | */ |
| | | function getFormat() { |
| | | return pack('Cv', 0x02, strlen($this->format)).$this->format; |
| | | if($this->format == '') { |
| | | return ''; |
| | | } |
| | | else |
| | | { |
| | | return pack('Cv', 0x02, strlen($this->format)).$this->format; |
| | | } |
| | | } |
| | | |
| | | /** |