Browse Source

if identity (uid) changes - reload any other open browser windows on next ping.

pull/309/head
friendica 9 years ago
parent
commit
e70573f34c
5 changed files with 267 additions and 249 deletions
  1. +2
    -1
      boot.php
  2. +5
    -1
      js/main.js
  3. +8
    -0
      mod/ping.php
  4. +251
    -247
      util/messages.po
  5. +1
    -0
      view/head.tpl

+ 2
- 1
boot.php View File

@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1349' );
define ( 'FRIENDICA_VERSION', '3.0.1350' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1144 );
@ -511,6 +511,7 @@ if(! class_exists('App')) {
$tpl = file_get_contents('view/head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array(
'$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!!
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => t('Delete this item?'),
'$comment' => t('Comment'),


+ 5
- 1
js/main.js View File

@ -117,6 +117,9 @@
/* nav update event */
$('nav').bind('nav-update', function(e,data){;
var invalid = $(data).find('invalid').text();
if(invalid == 1) { window.location.href=window.location.href }
var net = $(data).find('net').text();
if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
$('#net-update').html(net);
@ -211,7 +214,8 @@
function NavUpdate() {
if(! stopped) {
$.get("ping",function(data) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
$.get(pingCmd,function(data) {
$(data).find('result').each(function() {
// send nav-update event
$('nav').trigger('nav-update', this);


+ 8
- 0
mod/ping.php View File

@ -10,8 +10,16 @@ function ping_init(&$a) {
<result>";
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
if(local_user()){
// Different login session than the page that is calling us.
if(intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
echo '<invalid>1</invalid></result>';
killme();
}
$firehose = intval(get_pconfig(local_user(),'system','notify_full'));
$t = q("select count(*) as total from notify where uid = %d and seen = 0",


+ 251
- 247
util/messages.po
File diff suppressed because it is too large
View File


+ 1
- 0
view/head.tpl View File

@ -29,6 +29,7 @@
<script>
var updateInterval = $update_interval;
var localUser = $local_user;
function confirmDelete() { return confirm("$delitem"); }
function commentOpen(obj,id) {


Loading…
Cancel
Save