Commit graph

215 commits

Author SHA1 Message Date
Reedy
3f4e41a24e Noticed while looking at $wgShowUpdatedMarker related database queries, queries not using index order at all. Fixed up
Title.php at line 4313:
			array( 'wl_namespace' => $this->getNamespace(),
				'wl_title' => $this->getDBkey(),
				'wl_user' => $user->getId()
			),

In UserMailer.php at line 438:

array(
					'wl_title' => $title->getDBkey(),
					'wl_namespace' => $title->getNamespace(),
					'wl_user != ' . intval( $editor->getID() ),
					'wl_notificationtimestamp IS NULL',
				)

And line 455:

array( /* WHERE */
						'wl_title' => $title->getDBkey(),
						'wl_namespace' => $title->getNamespace(),
						'wl_user' => $watchers
					)

CREATE TABLE /*_*/watchlist (
  -- Key to user.user_id
  wl_user int unsigned NOT NULL,

  -- Key to page_namespace/page_title
  -- Note that users may watch pages which do not exist yet,
  -- or existed in the past but have been deleted.
  wl_namespace int NOT NULL default 0,
  wl_title varchar(255) binary NOT NULL default '',

  -- Timestamp when user was last sent a notification e-mail;
  -- cleared when the user visits the page.
  wl_notificationtimestamp varbinary(14)

) /*$wgDBTableOptions*/;

CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);

Change-Id: I633c009b4a1c614b966c69f042f94c2056e03784
2012-04-28 00:59:59 +01:00
Alexandre Emsenhuber
d8ef87afbf * (bug 35019) Fix for rr99942: edit summaries are no longer transformed in notification e-mails 2012-03-08 21:39:13 +00:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Antoine Musso
0ffeec1ddd (bug 34421) duplicate Subject / wrong To: headers in mail
This fixup our mail sending system which duplicated the Subject and To: header.
In some conditions it used only the email address for the From: field skipping
the username ($dest in old code only contains the email address).

Mails sent to a single recipients will look alike with mail() or PEAR Mail.
For multiple recipients:
 - php mail() will show the recipient email and 'undisclosed-recipients:'
 - PEAR Mail will only show 'undisclosed-recipients:'


Reverts r111820
Follow  r111819
Fixup    r93397
2012-02-18 15:34:12 +00:00
Antoine Musso
d8ab214e02 (bug 34421) avoid duplicate Subject headers in mail
r93397 duplicated the Subject header since it was passed both as an
argument of mail() and in the additional headers array.

This is r111765 done right.

Tested using both Pear and mail() methods.
2012-02-18 10:57:34 +00:00
Antoine Musso
9c2222010f revert r111765 bug 34421 avoid duplicate Subject headers
Was removing subjects when sending mails through PEAR.
2012-02-18 10:37:11 +00:00
Sam Reed
560ebfb721 Fix possibly undefined variables
Move $db further up

Return something on all paths
2012-02-18 01:07:42 +00:00
Antoine Musso
dd00e0dee2 (bug 34421) avoid duplicate Subject headers
r93397 duplicated the Subject header which was passed to the mail() function
as well as to the $headers array.
2012-02-17 17:02:24 +00:00
mrbluesky
c9f492e698 (bug 32210) UserMailer.php: New edit emails should offer a single-diff link. 2012-02-10 21:47:37 +00:00
Sam Reed
09a78c1368 More return documentation 2012-02-09 21:36:14 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Sam Reed
5d635eb62d Bug 33880 - $wgUsersNotifiedOnAllChanges should not send e-mail to user who made the edit. 2012-01-23 15:04:22 +00:00
Mark A. Hershberger
f7ae53ce33 w/s, remove unused vars per note in bug #33537 2012-01-06 20:54:24 +00:00
Sam Reed
5bd492d51c "else if" to "elseif" 2011-11-25 00:15:27 +00:00
Sam Reed
96641da58e Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:44:47 +00:00
Sam Reed
e27527f3f1 Remove duplicate setting of From 2011-10-16 19:52:46 +00:00
Alexandre Emsenhuber
d199c452f5 * Send "undisclosed-recipients" in "To" header when sending the mail to more than one user instead of checking $wgEnotifImpersonal. This was causing Special:EmailUser to send mails with that header when $wgEnotifImpersonal is true
* Fix for r91662: Return-Path must an e-mail address and only a e-mail address, it cannot be "Name <address@...>"
* Code simplification
2011-10-16 12:39:05 +00:00
Alexandre Emsenhuber
2be3042a35 * Do magic word parsing after parameter replacement in MediaWiki:Enotif_body and MediaWiki:Enotif_subject
* Fix link to Special:EmailUser in case $wgEnotifUseRealName was true and the user defined a real name, link was pointing to Special:EmailUser/Real_Name instead of Special:EmailUser/User_Name
* Simplified the code of EmailNotification::composeCommonMailtext()
2011-10-16 09:53:41 +00:00
Alexandre Emsenhuber
ae8b7b7ad5 Fix E_WARNING from r99863 2011-10-15 19:22:05 +00:00
Chad Horohoe
215376e771 Self revert r99899....I HATE YOU PHPUNIT YOU @#Q**#(#@(#@@#(!!! 2011-10-15 19:06:31 +00:00
Chad Horohoe
9a860bef79 Temporarily reverting r99863 to see if I can pin down test failures 2011-10-15 19:02:07 +00:00
Alexandre Emsenhuber
a2c2cb5687 * Added Language::userDate(), Language::userTime() and Language::userTimeAndDate() as new versions of respectively Language::date(), Language::time() and Language::timeanddate(), which take a User object in the second parameter to get time correction and format instead of having to do this when calling the methods and not wanting to user $wgUser's parameters.
* Moved Language::userAdjust() near other related function
* Updated ENotif stuff to use that functions so that the date format is not taken from the sending user but the receiver
* Removed $PAGEEDITDATEANDTIME parameter, unsed and not present in impersonal notification
* Also fixed the debug line in UserMailer::send()
2011-10-15 09:32:03 +00:00
Max Semenik
ac81e1c697 Unbreak sending emails using mailTargets() in safe_mode 2011-10-10 17:41:22 +00:00
Sam Reed
8a082cbf5c * (bug 31081) $wgEnotifUseJobQ causes many unnecessary jobs to be queued
Do some of the cheap checks before spawning attempting to send emails via any method
2011-09-22 12:14:21 +00:00
Daniel Friesen
289b2174f3 Followup r95547; Where'd that $ come from? 2011-08-29 18:53:59 +00:00
Daniel Friesen
9668ff4705 Followup r93417; Don't use $wgServer in a way that makes invalid Message-IDs. Instead use IDHost if set, otherwise extract the host from $wgServer. Also instead of a static UserMailer prefix use the wiki's id. 2011-08-26 00:01:55 +00:00
Roan Kattouw
8fc36a535a Use canonical URLs (introduced in r94995) for all URLs in e-mails 2011-08-19 14:46:03 +00:00
Roan Kattouw
b88212a0bf Expand all URLs in e-mail notifications to be full HTTP URLs. This prevents protocol-relative URLs from appearing in e-mail notifications if $wgServer is protocol-relative 2011-08-04 15:13:17 +00:00
Mark A. Hershberger
8e9deef3c4 re: r93415
* Document what happens as the result of each value returned
* Require boolean true to continue, not just a true value or strings
  would succeed
* Trim the arguments since the header array already contains them.
2011-08-02 19:35:01 +00:00
Mark A. Hershberger
a03831aa25 followup r93415 — there is no “$this” in a static method. 2011-07-29 01:15:52 +00:00
Mark A. Hershberger
58aa1cdff8 wtf, who made this typo? 2011-07-28 19:44:53 +00:00
Mark A. Hershberger
60808e86c1 follow up r93397 — missed msgid 2011-07-28 19:38:28 +00:00
Mark A. Hershberger
e5a99a4262 Add hook that could be the solution for Bug #28026 (“Enable e-mail
notifications for watchlist (EnotifWatchlist) on all small wikis”) to
make logging sent emails easier.
2011-07-28 19:19:42 +00:00
Mark A. Hershberger
2da8afe11e further sanity checks for sending email … bomb out if we aren't given
any user with an email address.
2011-07-28 19:15:58 +00:00
Mark A. Hershberger
36a106d255 * followup r93397 — missing $dest
* Otherwise clean up $dest usage
* Clean up Debug messages
2011-07-28 19:03:54 +00:00
Mark A. Hershberger
9ed750e026 array of objects tostring conversion works correctly in php 5.2.3+ 2011-07-28 17:25:19 +00:00
Mark A. Hershberger
be37f0ec30 Reduce mail header differences by moving all the header creation code
to one place.
2011-07-28 16:56:03 +00:00
Jeroen De Dauw
eb3cb586d3 small style tweaks 2011-07-27 15:58:56 +00:00
Jeroen De Dauw
7e1804e5eb style fix 2011-07-25 21:49:39 +00:00
Mark A. Hershberger
56836511f4 Fixes Bug#17866
Minimal check that we have more than an empty string before sending and email. NikeRabbit asked me about LQT sending email to users w/o email addresses and this looked like one good place to add a check.
2011-07-07 19:11:25 +00:00
Mark A. Hershberger
e41d79c125 Set envelope sender to the same as the From: address when PEAR mail is used. This is so that mail “bounces” to the expected place.
Note that this only works when $wgSMTP is set and (as a result) the PEAR mailer is used.

When $wgSMTP is not set, the envelope sender is set using $wgAdditionalMailParams set to something like “-f from@example.com”.  Someone should create some Envelope sender sanity in how the envelope sender is set.

Suggestion: if $wgAdditionalMailParams is not set, then use $wgEmergencyContact to create “-f $wgEmergencyContact” for php mailer and to set the Return-Path header for PEAR mailer.  I used “From:” for Return-Path here because it seemed most sensible.

See also: http://pear.php.net/bugs/bug.php?id=5017
2011-07-07 18:03:46 +00:00
Mark A. Hershberger
ab6a72a033 w/s fixup before patch 2011-07-07 17:43:31 +00:00
Alexandre Emsenhuber
550f780433 Fix for r89475: let's make this correctly 2011-06-04 20:27:51 +00:00
Alexandre Emsenhuber
ad7675d387 Added missing $PAGEEDITTIME replacement for impersonal mails 2011-06-04 20:21:50 +00:00
Alexandre Emsenhuber
885c45aca3 Use isAnon() so that the mail doesn't contain "anonymous user w.x.y.z" when a logged in user has "w.x.y.z" as real name and $wgEnotifUseRealName is true 2011-06-04 20:11:05 +00:00
Sam Reed
85a15bea84 More comment updates, addition of some braces also 2011-05-21 19:36:03 +00:00
Brian Wolff
3676997f02 (bug 29055) Make don't send email on minor edits preference apply to
changes to talk page in addition to watchlist edits.
2011-05-20 04:51:59 +00:00
Antoine Musso
9787dea7a2 use string as callback when possible (since PHP 5.2.3) 2011-05-18 20:33:47 +00:00
Antoine Musso
d8c59f8f0d Makes sure wgAdditionalMailParams is null in safe mode
The global is used for a call to PHP mail() function as a way to add
additional parameters.  This will cause mail() to send E_NOTICE when
using safe mode.

Since we could use the global at different places, it makes sens to
ensure it has a sane value through Setup.php

Follow up r75557
2011-05-18 20:28:44 +00:00