jdolitsky / AppDotNetPHP

PHP library for the App.net Stream API
34 stars 19 forks source link

createChannel - $pm not declared and is not necessary #44

Closed ghost closed 10 years ago

ghost commented 11 years ago

The $pm variable is not declared in this scope, and given that the function may not be used to create a PM channel, the ternary clause is unnecessary.

return $this->httpReq('post',$this->_baseUrl.'channels'.($pm?'/pm/messsages':''), $json, 'application/json');

With this version, however:

return $this->httpReq('post',$this->_baseUrl.'channels', $json, 'application/json');

with this data object:

{"type":"ca.roaringsky.group","writers":{"immutable":"0","public":"0","user_ids":"10403","73417"]}}

the call fails to complete. Suggestions?

jdolitsky commented 10 years ago

@roaringskysoftware is your data object valid JSON?

i think that

"user_ids":"10403","73417"]

is supposed to be

"user_ids": ["10403","73417"]