Skip to content

Commit

Permalink
Merge pull request savetheinternet#196 from majestrate/master
Browse files Browse the repository at this point in the history
patch for nntpchan stream
  • Loading branch information
czaks authored Aug 19, 2016
2 parents a779b96 + 1c3e6e5 commit fc21854
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/nntpchan/nntpchan.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ function gen_nntp($headers, $files) {
}

function nntp_publish($msg, $id) {
$s = fsockopen("tcp://localhost:1119");
global $config;
$server = $config["nntpchan"]["server"];
$s = fsockopen("tcp://$server");
fgets($s);
fputs($s, "MODE STREAM\r\n");
fgets($s);
fputs($s, "TAKETHIS $id\r\n");
fputs($s, $msg);
fputs($s, "\r\n.\r\n");
fgets($s);
fputs($s, "QUIT\r\n");
fclose($s);
}

Expand Down

0 comments on commit fc21854

Please sign in to comment.