Forcing New Line at Beginning of Signature for News Group Post? [message #159627] |
Sat, 13 June 2009 13:06 |
jm2morri
Messages: 225 Registered: January 2009 Location: Stratford, Ontario, Canad...
Karma: 0
|
Senior Member |
|
|
I have noticed that if a user doesn't end there message with a blank line that the signature that gets appended to the message when uploaded to an nntp server doesn't start on a new line.
I think this should be forced in. Can someone point me to the file that I'd need to add that in? I imagine it would be relatively easy to do if I knew where to do it.
James.
|
|
|
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159629 is a reply to message #159627] |
Sat, 13 June 2009 13:58 |
|
naudefj
Messages: 3771 Registered: December 2004
Karma: 28
|
Senior Member Administrator Core Developer |
|
|
Will this help:
Index: imsg_edt.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/imsg_edt.inc.t,v
retrieving revision 1.177
diff -u -r1.177 imsg_edt.inc.t
--- imsg_edt.inc.t 29 Apr 2009 20:34:12 -0000 1.177
+++ imsg_edt.inc.t 13 Jun 2009 13:57:43 -0000
@@ -544,7 +544,7 @@
define('sql_p', '{SQL_TABLE_PREFIX}');
$lock = $nntp->get_lock();
- $nntp->post_message($mtf->subject, $body.$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
+ $nntp->post_message($mtf->subject, $body."\n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
$nntp->close_connection();
$nntp->release_lock($lock);
} else {
Please let me know so we can update the CVS repository.
|
|
|
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159632 is a reply to message #159629] |
Sat, 13 June 2009 20:31 |
jm2morri
Messages: 225 Registered: January 2009 Location: Stratford, Ontario, Canad...
Karma: 0
|
Senior Member |
|
|
naudefj wrote on Sat, 13 June 2009 09:58 | Will this help:
Index: imsg_edt.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/imsg_edt.inc.t,v
retrieving revision 1.177
diff -u -r1.177 imsg_edt.inc.t
--- imsg_edt.inc.t 29 Apr 2009 20:34:12 -0000 1.177
+++ imsg_edt.inc.t 13 Jun 2009 13:57:43 -0000
@@ -544,7 +544,7 @@
define('sql_p', '{SQL_TABLE_PREFIX}');
$lock = $nntp->get_lock();
- $nntp->post_message($mtf->subject, $body.$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
+ $nntp->post_message($mtf->subject, $body."\n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
$nntp->close_connection();
$nntp->release_lock($lock);
} else {
Please let me know so we can update the CVS repository.
|
Maybe. Do I need to do anything after I make that change? Like rebuild something or other?
James.
|
|
|
|
|
|
|
|
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159772 is a reply to message #159762] |
Mon, 22 June 2009 11:50 |
jm2morri
Messages: 225 Registered: January 2009 Location: Stratford, Ontario, Canad...
Karma: 0
|
Senior Member |
|
|
naudefj wrote on Sat, 20 June 2009 21:54 | Why don't you try it and let us know if it solves the problem? Just remember to plain_text() the signature as well.
Should I back-out the patch against imsg_edt.inc.t?
|
Hi Frank,
I figured out what was going on. I have added a prefix of "-- " to the newsgroup signature. But then that goes through the plain_text() filter and the trailing space is removed.
But that is not the right way to do it. In nntp any signature should always start with the standard "-- " so I changed the line in imsg_edt.inc.t to
$nntp->post_message($mtf->subject, $body." \n-- \n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
So that it is always generated with this signature. I suppose a more generic solution would be to only add the "-- " if there was a signature but for me there always will be so it's not a problem.
Then the news group sig that the admin enters doesn't need to worry about this and it all works fine.
Cheers,
James.
|
|
|