Commit graph

94 commits

Author SHA1 Message Date
Kunal Mehta e25eb66a3a Support BasicFormatter::getLinkParams returning raw urls
In some cases like I7e309c04bc2456f4f87554a3d70dd6c77ba22f71 we
only have a raw URL and not a Title object. This supports that
usecase as well.

Change-Id: Ie18698e3ef755ca5a2cecc1f1cfb4254184bb576
2014-08-01 22:40:59 +00:00
bsitu d3d99772b9 Replace EchoBackend with mappers and gateway
* Get rid of EchoBackend by separating responsibilities into smaller objects

* Move main fetchNotification logic from API to a more appropriate place

* Add more unit testing coverage

Change-Id: I42f4d7566543332588431c21c220c0d64d026b70
2014-07-31 10:29:52 -07:00
bsitu c3f02705b0 Fix incorrect variable name
Bug: 68552
Change-Id: Iddf620954c3709e7c03c0b06e0bf8f3d08df366b
2014-07-25 02:21:18 +00:00
bsitu 1a2d5d7c4e Abstract the logic of getting last bundle notif into a method
We will likely need the very last record when building a bundle
notification in some cases ( talk page diff, flow unread post etc ),
it's better just to have that logic in a method

Change-Id: I8121e0cbed2beb066e27953d79225bb99c550553
2014-07-09 12:24:30 -07:00
Thiemo Mättig e205992d0b Remove unused code and fix missing/broken documentation
General code cleanup as reported by the PHPStorm static code
analysis. I hope it's not a problem that I made a lot of very
different (but all very tiny) changes in a single patch. If you
want to merge this but you think it's better to split it into
several patches first, please tell me.

Change-Id: I2e2c4bb47f8d20e038d28e236e2ff813b30504af
2014-06-04 04:54:00 +00:00
Ebrahim Byagowi 3a9f64ace3 i18n: Native digits on 'agent-other-display'
Change-Id: Idf6331b0c5656aea3d7a7af735be78981bdd8705
2013-12-20 11:01:45 +00:00
Kunal Mehta da04b97148 Allow icons to set different ltr/rtl versions
This reverts commit 9a2f96c022.

Change-Id: Iba7a15c4320cf508fd0a2436a8cfb686a54b262e
2013-12-19 15:07:26 -08:00
bsitu 9a2f96c022 Allow defining clousre for notification icon path
In some cases, we need to add wgLang->getDir() for icon patch, but
wgLang is not yet fully initialized

Bug: 58705
Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
2013-12-19 22:29:47 +00:00
Kunal Mehta 97a8fe1bef Don't use @deprecated for parameters
Makes Doxygen think the whole function is deprecated,
switched them to "@param $var type deprecated"

Change-Id: I1536396258ee62c5bf81a5eb0542656d6d754818
2013-11-23 18:17:36 +00:00
Kunal Mehta 52fab9c515 EchoBasicFormatter::formatFragment returns a Message object
Change-Id: I28228f904c4364a1e4c1c1a637bf78f506003eb6
2013-10-20 02:32:30 -07:00
bsitu b9a0a339c8 Add new method to process a param in escaped format
Change-Id: Ie777d7838b83d6109adf3ea8a71dd19240d8b6f5
2013-10-15 15:38:57 -07:00
jenkins-bot e8ab1156f6 Merge "Bundle message should show diff of all included revisions" 2013-10-03 17:32:39 +00:00
jenkins-bot b8e8228787 Merge "Typo fix + conditional fix" 2013-10-03 12:04:23 +00:00
bsitu 700271500a Bundle message should show diff of all included revisions
bug: 54391
Change-Id: I6c726d9d36e87fb5092b3c3e205e10ae0de557b4
2013-10-02 16:11:11 -07:00
bsitu 365ea041f2 Add a count for raw bundle data
Change-Id: I380c1e9ae61cba2ff02e4e380c3046ecc889f6aa
2013-10-02 15:28:22 -07:00
bsitu 16dbee7b26 Typo fix + conditional fix
bundleTitle['message'] defaults to empty string, it would never
be null, should just check if the string is empty

Change-Id: I6b9dd8b8a94fed114c0799004848daed472daf3a
2013-09-30 13:28:58 -07:00
kaldari 08fc83b6de Cleaning up Echo 'base' module.
Removing unused functions and declaring correct dependencies.

Targetting to desktop and mobile so it can be used by both.

Also removing dismiss-related code from the formatter.

Change-Id: Icccce64cfb3c564ab468a93ccdba9c5a61687fd5
2013-09-23 11:29:49 -07:00
bsitu 06e7317472 Archive page and overlay should respect ?uselang=xxx
In addition, any message used in the email should be
sent in the user's language.

Bug: 52992
Change-Id: I3585f28d4ec97b86a467958bdfd603791f293d52
2013-09-09 13:44:05 -07:00
EBernhardson (WMF) e3bdd61952 Merge "Preventing empty payloads from being created when using summary" 2013-09-03 17:40:42 +00:00
kaldari d1463ea6a7 Preventing empty payloads from being created when using summary
Also making sure that footer has some amount of separation from
the notification title even if there is no payload.

Change-Id: I85a1a7989539044a0b0b53e76e70ddee9bb7165c
2013-08-29 15:10:06 -07:00
bsitu 5f50f84bbd Invalid argument supplied for foreach() in BasicFormatter.php
bug: 52897
Change-Id: I28f447af75f699d4bd7d4d045f030e70cea437d6
2013-08-15 17:53:24 -07:00
jenkins-bot 7addcc4470 Merge "Split the code to generate a proper URL/link from setTitleLink()" 2013-08-07 07:12:56 +00:00
kaldari 2f6591febe Making title-params no longer required.
In theory, a notification could not need any contextual information
so there's no reason we should make it required.

Now, if the title-params are not provided in the notifcation
definition, it just sets the value to an empty array.

Change-Id: Iba5ce5cc56010101c5e64976c95b37a215dc99fa
2013-08-01 17:52:47 -07:00
Matthias Mullie 54e2e0f69a Split the code to generate a proper URL/link from setTitleLink()
The reason I'm splitting this is that, not only do I want to create
a link to the 'title', but also for another param (in my case: link
to the AFTv5 permalink page)

Change-Id: I834b50ca144e7d08db830726480da19e1b406a27
2013-07-31 17:07:50 +02:00
bsitu 2c7ec70dc6 The email should be sent in the recipient's language
At the moment it is sent in the sender's language.

Bug: 52298
Change-Id: I7f689963105585cf74a902cf975fffb592135ed4
2013-07-31 02:47:15 +00:00
jenkins-bot 82e97088a1 Merge "(bug 51005) Add secondary link to the archive page" 2013-07-30 08:54:44 +00:00
bsitu 0b1275b9e3 user talk and mention notification improvement
http://www.mediawiki.org/wiki/Echo_%28Notifications%29/Feature_requirements#Improved_Notification_Structure

Change-Id: I2da35e8ed092c42ac95ae34012426834a37c3cde
2013-07-29 18:07:43 -07:00
bsitu 7f33cc98fa (bug 46665) Add HTML email support to email digest
Change-Id: I3b881acbcf4b18fc0401364ea0a6bc993d2c2246
2013-07-23 13:20:33 +02:00
bsitu 2c74f66f18 Add HTML email support to Echo notification
To test the HTML email:

1. install the latest version of php-mail and php-mail-mime package, they are required
   by the core sendmail function to send HTML email
2. set $wgAllowHTMLEmail = true before loading Echo in LocalSetting.php

Change-Id: Ia4b98b14e135742b84f1b0e04589b0efdd24e954
2013-07-23 13:20:33 +02:00
bsitu 353f4e8ab5 (bug 51005) Add secondary link to the archive page
Change-Id: I9b1e8fd76eacda3c4bcb5ffc1e3799204da52960
2013-07-12 11:29:01 -07:00
bsitu 1ebc4b53de Title diff links should not include any fragment
Change-Id: I54d602ad910035033c3ff2741616fd0405c6e290
2013-07-02 14:20:01 -07:00
kaldari 972e14672f New primary and secondary link behavior for Echo
See https://www.mediawiki.org/wiki/Echo/Feature_requirements#Flyout
and https://www.mediawiki.org/wiki/Echo/Feature_requirements#HTML_single_email_notifications

Also includes some related style changes per Vibha

Also removing feedback link from overlay since it's no longer needed

Change-Id: I94aed697e87126ed8ad6d1d416c99bafaa53ac53
2013-06-27 16:12:16 -07:00
Erik Bernhardson 34fbeaf8c9 Respect revision suppression within Echo
Update the echo formatter to properly display suppressed revision content

Bug: 48059
Change-Id: Iee3c9a41ad24c66b0e2abdd5f1375ebdbd74314e
2013-06-18 11:00:50 -07:00
bsitu 801bde9ec3 Remove unused global variable and update function return type
Change-Id: I2f6e0388c2d1218e72b70a69b429884b39dc096f
2013-06-17 21:51:43 +00:00
jenkins-bot 250127669b Merge "Link directly to the edited section from edit-user-talk events" 2013-05-17 00:24:30 +00:00
Erik Bernhardson e058b980b5 Link directly to the edited section from edit-user-talk events
Adjusted the edit-user-talk event creation to detect and record which section
of the talk page was edited. Flyout, special page, and email messages have
been adjusted to use this section title as a URL fragment when available.

Bug: 46937
Change-Id: I161e2ffda2f2540f64de90cc621fb3b69479d0db
2013-05-16 17:13:16 -07:00
bsitu f812389ce5 (bug 48302) Broken link in plain text email notification
Change-Id: I101fe3c1c3dbf913982b9040885b2acc633e711a
2013-05-15 12:34:10 -07:00
jenkins-bot 17b648f18f Merge "Remove dead code" 2013-05-14 07:18:19 +00:00
Erik Bernhardson d49b9a5223 Remove dead code
While writing tests i noticed that this is dead code that will never be called. It
was originally used but several commits have piled up to cause its deprecation.
Upon review of the git history it seems the general idea behind content-* turned
into the 'payload' key. the commentText formatting was moved to payload for future
use, the i18n keys have been pruned.

Change-Id: I5ef360759db53d54a834afc8b71e9c8807de0284
2013-05-13 18:11:42 -07:00
bsitu 792dc034e0 (bug 48302) Trailing dot in link is ignored in plain text email
A random link may contain trailing dot and it doesn't get linked

Change-Id: Ia7d3a4a437438ba473c24b3f4f98bb133cd52954
2013-05-13 15:24:20 -07:00
Matthew Flaschen d3b67e2122 Change icons to use img tags, allowing easier customization:
* Icon can be defined using a path or a URL
* Extensions don't need custom CSS, but add icon through BeforeCreateEchoEvent
* Sites set their notification icon in LocalSettings.php or equivalent

Bug: 46585
Change-Id: Ifc02b653d07de19229dfb2604305e32f3bd595fe
2013-04-29 06:05:40 +00:00
bsitu c7922a366c Email digest header tweaks
Plus adding escape to some of the messages

Bug: 47095
Change-Id: I296de4e5ebe92b737837c7ddcf3f631b16a9cf8b
2013-04-17 14:43:31 -07:00
bsitu d44ed993a2 Add email bundling function to Echo notification
* This patch needs intensive testing on Redis delayed job queue
* This patch is -2 mainly for redis/phpredis are not ready on test/test2/mediawiki

To test this locally, you need to:
* set up Redis and phpredis locally
* add the following to localSettings.php
    $wgJobTypeConf['MWEchoNotificationEmailBundleJob'] = array(
        'class'       => 'JobQueueRedis',
        'redisServer' => '127.0.0.1',
        'redisConfig' => array( 'connectTimeout' => 1 ),
        'claimTTL'    => 3600,
        'checkDelay'  => true
    );
* set $wgMainCacheType to CACHE_DB or memcache
* set $wgEchoBundleEmailInterval to smaller number for testing purpose, 0 to disable email bundling

Change-Id: I9313e7f6ed3e13478cec294b5b8408fe8e941faf
2013-04-11 11:25:14 -07:00
jenkins-bot 841d958bfb Merge "Disabling notification dismiss interface for now per Fabrice" 2013-04-11 17:10:43 +00:00
kaldari e641d6f7c7 Disabling notification dismiss interface for now per Fabrice
Notification categories can still be unsubscribed to in the prefs

Change-Id: I91046f840add2cd6e02b0b91078fd2ac377ca871
2013-04-10 17:22:40 -07:00
jenkins-bot 8f77e67e6f Merge "Making agent param logic consistant" 2013-04-10 17:32:47 +00:00
bsitu cbd88322f2 Add default params to avoid massive if/else block
Change-Id: I966d16525220565e805fda582c5f88a7978faa37
2013-04-05 19:33:01 +00:00
bsitu 6a3624b0e4 Add web bundling function to Echo notification
* add web bundling feature
* unify event_timestamp with notification_timestamp
* remove echo_subscription
* update article_link to page_link notification with new logic
* remove duplicated function from MWDbEchoEmailBatch since it's defined in parent class

Change-Id: I2fa91c44edb020209b468fe13f894d9db3732e69
2013-04-04 10:53:46 -07:00
jenkins-bot e4483d8130 Merge "Some cleanup to Formatter" 2013-04-04 17:48:24 +00:00
Kaldari 002d816de1 Merge "Merge the text of the welcome message into the title." 2013-04-04 17:40:19 +00:00