Skip to content

Commit

Permalink
Remove FB notification info from block.
Browse files Browse the repository at this point in the history
FB no longer allows access to user's notifications except with the
'manage_notification' permission - which the application developer
must apply to FB for with a good use case (?!).
special circumstances that you nee
  • Loading branch information
mrubinsk committed Mar 5, 2015
1 parent 4199051 commit 3b0182e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
3 changes: 0 additions & 3 deletions horde/js/facebookclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var Horde_Facebook = Class.create({
* opts.refreshrate
* opts.content
* opts.endpoint,
* opts.notifications
* opts.getmore
* opts.button
* opts.instance
Expand Down Expand Up @@ -113,7 +112,6 @@ var Horde_Facebook = Class.create({
getNewEntries: function()
{
var params = {
'notifications': this.opts.notifications,
'oldest': this.oldest,
'newest': this.newest,
'instance': this.opts.instance,
Expand All @@ -128,7 +126,6 @@ var Horde_Facebook = Class.create({
_getNewEntriesCallback: function(response)
{
$(this.opts.content).insert({ 'top': response.c });
$(this.opts.notifications).update(response.nt);

this.newest = response.n;
if (!this.oldest) {
Expand Down
22 changes: 1 addition & 21 deletions horde/lib/Ajax/Application/FacebookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Horde_Ajax_Application_FacebookHandler extends Horde_Core_Ajax_Application
* - filter:
* - oldest:
* - newest:
* - notifications:
* - instance:
*
*
Expand All @@ -51,24 +50,6 @@ public function facebookGetStream()
return $html;
}

// Notifications
$n_html = '';
if ($this->vars->notifications) {
try {
$notifications = $facebook->notifications->get();
$n_html = _("New Messages:")
. ' ' . $notifications['messages']['unread']
. ' ' . _("Pokes:") . ' ' . $notifications['pokes']['unread']
. ' ' . _("Friend Requests:") . ' ' . count($notifications['friend_requests'])
. ' ' . _("Event Invites:") . ' ' . count($notifications['event_invites']);
} catch (Horde_Service_Facebook_Exception $e) {
$html = sprintf(_("There was an error making the request: %s"), $e->getMessage());
$html .= sprintf(_("You can also check your Facebook settings in your %s."), $url->link() . _("preferences") . '</a>');

return $html;
}
}

// Parse the posts.
$posts = $stream->data;
$newest = new Horde_Date($posts[0]->created_time);
Expand All @@ -85,8 +66,7 @@ public function facebookGetStream()
return array(
'o' => $oldest,
'n' => $newest,
'c' => $html,
'nt' => $n_html
'c' => $html
);
}

Expand Down
9 changes: 0 additions & 9 deletions horde/lib/Block/FbStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ protected function _params()
'name' => _("Maximum number of entries to display"),
'default' => '20'
),
'notifications' => array(
'type' => 'boolean',
'name' => _("Show notifications"),
'default' => true
),
'height' => array(
'name' => _("Height of stream content (width automatically adjusts to block)"),
'type' => 'int',
Expand Down Expand Up @@ -119,7 +114,6 @@ protected function _content()
endpoint: '{$endpoint}',
content: '{$instance}_fbcontent',
status: '{$instance}_currentStatus',
notifications: '{$instance}_fbnotifications',
getmore: '{$instance}_getmore',
'input': '{$instance}_newStatus',
'button': '{$instance}_button',
Expand All @@ -132,9 +126,6 @@ protected function _content()

// Start building the block UI.
$html .= '<div style="padding: 8px 8px 0 8px">';
if (!empty($this->_params['notifications'])) {
$html .= '<div class="fbinfobox" id="' . $instance . '_fbnotifications"></div>';
}

try {
$fbperms = $facebook->users->getAppPermissions();
Expand Down

0 comments on commit 3b0182e

Please sign in to comment.