[livejournal] r23192: LJSUP-14052: Web Notifications for LJ pr...
Committer: sbelyaev
LJSUP-14052: Web Notifications for LJ prototype [internal]U trunk/cgi-bin/LJ/Event.pm U trunk/cgi-bin/LJ/NotificationMethod.pm
Modified: trunk/cgi-bin/LJ/Event.pm
===================================================================
--- trunk/cgi-bin/LJ/Event.pm 2012-10-24 12:20:34 UTC (rev 23191)
+++ trunk/cgi-bin/LJ/Event.pm 2012-10-24 13:01:41 UTC (rev 23192)
@@ -411,6 +411,34 @@
return $self->as_string($u);
}
+# return a string representing an "Web Notification" subject (or another popup
+# notification type)
+# notification sent to the passed user notifying them that this event has
+# happened.
+#
+# this is a virtual function; base class function returns whatever "as_string"
+# method returns.
+#
+# $wlm->send($u, $event->as_web_subject($u));
+sub as_web_subject {
+ my ($self, $u) = @_;
+ return $self->as_email_subject($u);
+}
+
+# return a string representing an "Web Notification" body (or another popup
+# notification type)
+# notification sent to the passed user notifying them that this event has
+# happened.
+#
+# this is a virtual function; base class function returns whatever "as_string"
+# method returns.
+#
+# $wlm->send($u, $event->as_web_body($u));
+sub as_web_body {
+ my ($self, $u) = @_;
+ return $self->as_string($u);
+}
+
# return a string representing an email subject of an email notification sent
# to the passed user notifying them that this event has happened.
#
Modified: trunk/cgi-bin/LJ/NotificationMethod.pm
===================================================================
--- trunk/cgi-bin/LJ/NotificationMethod.pm 2012-10-24 12:20:34 UTC (rev 23191)
+++ trunk/cgi-bin/LJ/NotificationMethod.pm 2012-10-24 13:01:41 UTC (rev 23192)
@@ -11,6 +11,7 @@
LJ::NotificationMethod::DebugLog
LJ::NotificationMethod::Alerts
LJ::NotificationMethod::Push
+ LJ::NotificationMethod::Web
);
# this mofo is basically just an interface
