$url = parse_url(Banana::$nntp_host);
if ($url['scheme'] == 'nntps' || $url['scheme'] == 'snntp') {
$url['host'] = 'ssl://' . $url['host'];
- }
- if (!isset($url['port'])) {
+ if (!isset($url['port'])) {
+ $url['port'] = 563;
+ }
+ } else if (!isset($url['port'])) {
$url['port'] = 119;
}
parent::__construct($url['host'], $url['port']);
if (isset($url['user'])) {
$this->authinfo($url['user'], $url['pass']);
- }
+ }
}
/** Return the descript;ion of the current box
foreach ($this->boxes as $group=>&$desc) {
list($msgnum, $first, $last, $groupname) = $this->group($group);
$this->ingroup = $group;
- $new = count($this->newnews($group, $since));
+ $new = $this->newnews($group, $since);
+ if (!is_array($new)) {
+ $new = 0;
+ } else {
+ $new = count($new);
+ }
$desc['msgnum'] = $msgnum;
$desc['unread'] = $new;
}
/** Send the message
*/
- public function send(BananaMessage &$message)
+ public function send(BananaMessage $message)
{
$sources = $message->get(true);
return $this->post($sources);
/** Cancel the message
*/
- public function cancel(BananaMessage &$message)
+ public function cancel(BananaMessage $message)
{
$headers = Array('From' => Banana::$profile['From'],
'Newsgroups' => Banana::$group,