From 5c062aaec410ca1d5275a4a7079dadddb82c3097 Mon Sep 17 00:00:00 2001 From: Treer Date: Sun, 3 Jul 2016 22:21:48 +1000 Subject: force immediate avatar update --- include/nav.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 6a79b6530..1fb0e98dc 100644 --- a/include/nav.php +++ b/include/nav.php @@ -255,6 +255,19 @@ $powered_by = ''; '$pleasewait' => t('Please wait...') )); + + if(x($_SESSION, 'reload_avatar') && $observer) { + // The avatar has been changed on the server but the browser doesn't know that, + // force the browser to reload the image from the server instead of its cache. + $tpl = get_markup_template('force_image_reload.tpl'); + + App::$page['nav'] .= replace_macros($tpl, array( + '$imgUrl' => $observer['xchan_photo_m'] + )); + unset($_SESSION['reload_avatar']); + } + + call_hooks('page_header', App::$page['nav']); } -- cgit v1.2.3