Browse Source

- Clean login presence => keep the state (status + show) before the logout

- Clean old lines
pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
7015db9969
  1. 3
      system/Datas/Post.php
  2. 3
      system/Jabber.php
  3. 6
      system/Widget/WidgetCommon.php
  4. 1
      system/Widget/widgets/Feed/Feed.php
  5. 11
      system/Widget/widgets/Logout/Logout.php
  6. 1
      system/Widget/widgets/Notifs/Notifs.php
  7. 16
      system/Widget/widgets/Profile/Profile.php

3
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();

3
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);
}
/**

6
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 .= '<a target="_blank" href="'.$attachment->getData('link').'"><img alt="'.$attachment->getData('title').'" title="'.$attachment->getData('title').'" src="'.$attachment->getData('thumb').'"></a>';
$tmp .= '</div>';
}
$tmp = $post->build();
if($message->getPlace() != false)
$tmp .= '<span class="place">
<a

1
system/Widget/widgets/Feed/Feed.php

@ -76,7 +76,6 @@ class Feed extends WidgetCommon {
function ajaxPublishItem($content)
{
movim_log($content." ".htmlentities(rawurldecode($content)));
if($content != '')
$this->xmpp->publishItem(htmlentities(rawurldecode($content)));
}

11
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
<a onclick="'.$this->genCallAjax('ajaxLogout').'">'.$txt[5].'</a>
</div>
';
$presence = Cache::c('presence');
if($presence['boot'] == true)
$html .= '<script type="text/javascript">setTimeout(\''.$this->genCallAjax('ajaxSetStatus', '"boot"').'\', 5000);</script>';
return $html;
}

1
system/Widget/widgets/Notifs/Notifs.php

@ -76,7 +76,6 @@ class Notifs extends WidgetBase
}
function ajaxSubscribed($jid) {
movim_log($jid);
$this->xmpp->subscribedContact($jid);
}

16
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 ='<h1>'.$me->getTrueName().'</h1><img src="'.$me->getPhoto().'"/>';
/*$html = '
<table>
<tr>
<td>
<img src="'.$me->getPhoto().'">
</td>
<td>
<h1>'.$me->getTrueName().'</h1>
</td>
</tr>
</table>
';*/
$html .= '
<input
type="text"

Loading…
Cancel
Save