From 7015db99697c13698c16370d3ac3792b8767671f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Wed, 13 Jun 2012 21:42:24 +0200 Subject: [PATCH] - Clean login presence => keep the state (status + show) before the logout - Clean old lines --- system/Datas/Post.php | 3 --- system/Jabber.php | 3 ++- system/Widget/WidgetCommon.php | 6 ++---- system/Widget/widgets/Feed/Feed.php | 1 - system/Widget/widgets/Logout/Logout.php | 11 +++-------- system/Widget/widgets/Notifs/Notifs.php | 1 - system/Widget/widgets/Profile/Profile.php | 16 +--------------- 7 files changed, 8 insertions(+), 33 deletions(-) diff --git a/system/Datas/Post.php b/system/Datas/Post.php index 2e5ec40c4..27ac31c14 100644 --- a/system/Datas/Post.php +++ b/system/Datas/Post.php @@ -56,9 +56,6 @@ class Post extends DatajarBase { } public function setPost($array, $from, $parent = false, $key = false) { - - movim_log($array); - if($key == false) { $user = new User(); $key = $user->getLogin(); diff --git a/system/Jabber.php b/system/Jabber.php index 3cd325de4..fa3203ca6 100644 --- a/system/Jabber.php +++ b/system/Jabber.php @@ -144,7 +144,8 @@ class Jabber $this->jaxl->startCore('bosh'); } - self::setStatus(t('Connecting...'), false, false, true); + movim_log($presence = Cache::c('presence')); + self::setStatus($presence['status'], $presence['show'], false, true); } /** diff --git a/system/Widget/WidgetCommon.php b/system/Widget/WidgetCommon.php index 21dbb2fbc..cb75ab6a0 100644 --- a/system/Widget/WidgetCommon.php +++ b/system/Widget/WidgetCommon.php @@ -39,13 +39,11 @@ class WidgetCommon extends WidgetBase { $attachments = AttachmentHandler::getAttachment($user->getLogin(), $message->getData('nodeid')); if($attachments) { - foreach($attachments as $attachment) { + foreach($attachments as $attachment) $tmp .= ''.$attachment->getData('title').''; $tmp .= ''; } - - $tmp = $post->build(); - + if($message->getPlace() != false) $tmp .= ' xmpp->publishItem(htmlentities(rawurldecode($content))); } diff --git a/system/Widget/widgets/Logout/Logout.php b/system/Widget/widgets/Logout/Logout.php index 00ae93cc1..83eb48659 100644 --- a/system/Widget/widgets/Logout/Logout.php +++ b/system/Widget/widgets/Logout/Logout.php @@ -52,8 +52,7 @@ class Logout extends WidgetBase 'presence', array( 'status' => $presence['status'], - 'show' => $presence['show'], - 'boot' => true + 'show' => $presence['show'] ) ); $this->xmpp->logout(); @@ -63,14 +62,13 @@ class Logout extends WidgetBase { // We update the cache with our status and presence $presence = Cache::c('presence'); - movim_log($presence); + if($show == "boot") $show = $presence['show']; Cache::c( 'presence', array( 'status' => $presence['status'], - 'show' => $show, - 'boot' => false + 'show' => $show ) ); $this->xmpp->setStatus($presence['status'], $show); @@ -96,9 +94,6 @@ class Logout extends WidgetBase '.$txt[5].' '; - $presence = Cache::c('presence'); - if($presence['boot'] == true) - $html .= ''; return $html; } diff --git a/system/Widget/widgets/Notifs/Notifs.php b/system/Widget/widgets/Notifs/Notifs.php index 706c8f673..f1925914f 100644 --- a/system/Widget/widgets/Notifs/Notifs.php +++ b/system/Widget/widgets/Notifs/Notifs.php @@ -76,7 +76,6 @@ class Notifs extends WidgetBase } function ajaxSubscribed($jid) { - movim_log($jid); $this->xmpp->subscribedContact($jid); } diff --git a/system/Widget/widgets/Profile/Profile.php b/system/Widget/widgets/Profile/Profile.php index 029b82056..1c9b2c3ed 100644 --- a/system/Widget/widgets/Profile/Profile.php +++ b/system/Widget/widgets/Profile/Profile.php @@ -28,8 +28,6 @@ class Profile extends WidgetBase $this->addcss('profile.css'); $this->addjs('profile.js'); $this->registerEvent('myvcard', 'onMyVcardReceived'); - - $this->cached = true; } function onMyVcardReceived($vcard = false) @@ -47,7 +45,6 @@ class Profile extends WidgetBase array( 'status' => rawurldecode($status), 'show' => $presence['show'], - 'boot' => false ) ); $this->xmpp->setStatus(rawurldecode($status), $presence['show']); @@ -63,18 +60,7 @@ class Profile extends WidgetBase if(isset($me[0])) { $me = $me[0]; $html ='

'.$me->getTrueName().'

'; - /*$html = ' - - - - - -
- - -

'.$me->getTrueName().'

-
- ';*/ + $html .= '