class BananaNNTP extends BananaNNTPCore implements BananaProtocoleInterface
{
- private $groupname = null;
private $description = null;
private $ingroup = null;
/** Build a protocole handler plugged on the given box
*/
- public function __construct($box = null)
+ public function __construct()
{
$url = parse_url(Banana::$host);
if ($url['scheme'] == 'nntps' || $url['scheme'] == 'snntp') {
parent::__construct($url['host'], $url['port'], 120, false);
$this->authinfo($url['user'], $url['pass']);
}
- $this->groupname = $box;
}
/** Return the descript;ion of the current box
if ($this->description) {
return $this->description;
}
- $descs = $this->xgtitle($this->groupname);
- if (isset($descs[$this->groupname])) {
- $this->description = $descs[$this->groupname];
+ $descs = $this->xgtitle(Banana::$group);
+ if (isset($descs[Banana::$group])) {
+ $this->description = $descs[Banana::$group];
}
return $this->description;
}
*/
public function getMessage($id, array $msg_headers = array(), $is_msgid = false)
{
- if (!$is_msgid && $this->groupname != $this->ingroup) {
+ if (!$is_msgid && Banana::$group != $this->ingroup) {
if (is_null(Banana::$spool)) {
- $this->group($this->groupname);
- $this->ingroup = $this->groupname;
+ $this->group(Banana::$group);
+ $this->ingroup = Banana::$group;
} else {
$id = array_search($id, Banana::$spool->ids);
}
*/
public function getIndexes()
{
- list($msgnum, $first, $last, $groupname) = $this->group($this->groupname);
- $this->ingroup = $this->groupname;
+ list($msgnum, $first, $last, $groupname) = $this->group(Banana::$group);
+ $this->ingroup = Banana::$group;
return array($msgnum, $first, $last);
}
*/
public function getNewIndexes($since)
{
- return $this->newnews($this->groupname, $since);
+ return $this->newnews(Banana::$group, $since);
}
/** Return true if can post
public function cancel(BananaMessage &$message)
{
$headers = Array('From' => Banana::$profile['From'],
- 'Newsgroups' => $this->groupname,
+ 'Newsgroups' => Banana::$group,
'Subject' => 'cmsg ' . $message->getHeaderValue('message-id'),
'Control' => 'cancel ' . $message->getHeaderValue('message-id'));
$headers = array_merge($headers, Banana::$custom_hdr);