Browse Source

Display Community logo everywhere

pull/378/head
Timothée Jaussoin 9 years ago
parent
commit
340084f9b0
  1. 2
      app/models/postn/Postn.php
  2. 17
      app/models/postn/PostnDAO.php
  3. 3
      app/widgets/Menu/Menu.php
  4. 4
      app/widgets/Post/_post_card.tpl

2
app/models/postn/Postn.php

@ -435,7 +435,7 @@ class Postn extends Model
public function getLogo()
{
$p = new Picture;
return $p->get($this->origin.$this->node, 120);
return $p->get($this->origin.$this->node, 50);
}
public function getUUID()

17
app/models/postn/PostnDAO.php

@ -198,7 +198,7 @@ class PostnDAO extends SQL
];
$this->_sql = '
select postn.*, contact.*, postn.aid from postn
select postn.*, contact.*, postn.aid, item.logo from postn
left outer join contact on postn.aid = contact.jid
left outer join item
on postn.origin = item.server
@ -463,11 +463,14 @@ class PostnDAO extends SQL
{
$this->_sql = '
select *, postn.aid from postn
left outer join item
on postn.origin = item.server
and postn.node = item.node
left outer join contact on postn.aid = contact.jid
where (
(postn.origin in (select jid from rosterlink where session = :origin and rostersubscription in (\'both\', \'to\')) and node = \'urn:xmpp:microblog:0\')
or (postn.origin = :origin and node = \'urn:xmpp:microblog:0\')
or ((postn.origin, node) in (select server, node from subscription where jid = :origin))
(postn.origin in (select jid from rosterlink where session = :origin and rostersubscription in (\'both\', \'to\')) and postn.node = \'urn:xmpp:microblog:0\')
or (postn.origin = :origin and postn.node = \'urn:xmpp:microblog:0\')
or ((postn.origin, postn.node) in (select server, postn.node from subscription where jid = :origin))
)
and postn.node not like \'urn:xmpp:microblog:0:comments/%\'
and postn.node not like \'urn:xmpp:inbox\'
@ -520,7 +523,10 @@ class PostnDAO extends SQL
$this->_sql = '
select *, postn.aid from postn
left outer join contact on postn.aid = contact.jid
where ((postn.origin, node) in (select server, node from subscription where jid = :origin))
left outer join item
on postn.origin = item.server
and postn.node = item.node
where ((postn.origin, postn.node) in (select server, postn.node from subscription where jid = :origin))
order by postn.published desc
';
@ -543,6 +549,7 @@ class PostnDAO extends SQL
$this->_sql = '
select *, postn.aid from postn
left outer join contact on postn.aid = contact.jid
where postn.origin = :origin and postn.node = \'urn:xmpp:microblog:0\'
order by postn.published desc
';

3
app/widgets/Menu/Menu.php

@ -51,6 +51,9 @@ class Menu extends \Movim\Widget\Base
$count = $pd->getCountSince($since);
$post = $packet->content;
// We reload a fresh Post
$post = $pd->get($post->origin, $post->node, $post->nodeid);
if($count > 0
&& is_object($post)
&& (strtotime($post->published) > strtotime($since))) {

4
app/widgets/Post/_post_card.tpl

@ -5,6 +5,10 @@
<span class="primary icon bubble color red tiny">
+18
</span>
{elseif="$post->logo"}
<span class="primary icon bubble color white">
<img src="{$post->getLogo()}"/>
</span>
{elseif="$post->isMicroblog()"}
{$url = $post->getContact()->getPhoto('m')}
{if="$url"}

Loading…
Cancel
Save