Re: Distinguish between mail and web interface creates

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
Hi Tom:

In message <MWHPR08MB29416901FA0410F82548C00FCA969@MWHPR08MB2941.namprd08.prod.
outlook.com>,
Tom Ekberg writes:
>I have a roundup tracker that allows users to create issues using
>roundup-mailgw and also using the web interface. Users have requested
>that they receive a confirmation email containing the issue number
>when an issue is created by roundup-mailgw. There is no point in
>sending this email when using the web interface because they will see
>it.
>
>Is there a way for a detector to distinguish a create being done by
>roundup-mailgw from a create being done by the web interface?

Look for tx_Source in customizing.html/txt and upgrading.html/txt.
tx_Source was added in 1.4.22, so you need a version newer than that.

There is an example in customizing.txt of using it to prevent changing
the nosy list unless it is an authenticated connection.

In this case you want to match 'email' or 'email-sig-openpgp' to
indicate the transaction was done via web. Sadly there is no "doc"
per-se on this. It's only documented by example without an exhaustive
list of values. The list of values can be pieced together from
upgrading.txt but.... (Another reason why customizing.txt needs to be
split into a ref manual and an examples manual. Any people with doc
skills want to help with
https://issues.roundup-tracker.org/issue2551102?)

One thing to consider is that I don't think there is an option in the
email generation interface (cl.nosymessage) called in nosyreaction.py
to eliminate just the author. So you may need to set
db.config.MESSAGES_TO_AUTHOR = "no" on the fly to prevent the author
from getting the email but allow other users on the nosy list to get
the email.

I want to claim that this change to db.config.MESSAGES_TO_AUTHOR will
only apply to the current connection as any other connection will get a
different db connection. However it may be worth:

  saved_nosy_state = db.config.MESSAGES_TO_AUTHOR
  db.config.MESSAGES_TO_AUTHOR = 'no'
  cl.nosymessages(...)
  db.config.MESSAGES_TO_AUTHOR = saved_nosy_state

just in case.

Let me know what you come up with. It should be added to the wiki.
Have a great weekend.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.