various fixes for the new group suggestion

This commit is contained in:
Hannes Mannerheim 2015-08-26 00:11:31 +02:00
parent 976be81ce9
commit 45b0019750
5 changed files with 41 additions and 8 deletions

View File

@ -428,7 +428,7 @@ class QvitterPlugin extends Plugin {
$notice_groups = $notice->getGroups();
$group_addressees = false;
foreach($notice_groups as $g) {
$group_addressees = array('nickname'=>$g->nickname,'url'=>$g->mainpage);
$group_addressees[] = array('nickname'=>$g->nickname,'url'=>$g->mainpage);
}
$twitter_status['statusnet_in_groups'] = $group_addressees;
@ -542,7 +542,7 @@ class QvitterPlugin extends Plugin {
}
}
if($notice->object_type == 'activity' || $notice->object_type == 'http://activitystrea.ms/schema/1.0/activity') {
if($notice->source == 'activity' || $notice->object_type == 'activity' || $notice->object_type == 'http://activitystrea.ms/schema/1.0/activity') {
$twitter_status['is_activity'] = true;
}
else {
@ -662,7 +662,7 @@ class QvitterPlugin extends Plugin {
assert($notice->id > 0); // since we removed tests below
// don't add notifications for activity type notices
if($notice->object_type == 'activity') {
if($notice->source == 'activity' || $notice->object_type == 'activity' || $notice->object_type == 'http://activitystrea.ms/schema/1.0/activity') {
return true;
}

View File

@ -246,14 +246,19 @@ class ApiQvitterStatusesUpdateAction extends ApiAuthAction
}
$upload = null;
try {
$upload = MediaFile::fromUpload('media', $this->scoped);
$this->status .= ' ' . $upload->shortUrl();
/* Do not call shortenlinks until the whole notice has been build */
} catch (NoUploadedMediaException $e) {
// There was no uploaded media for us today.
}
if (isset($upload)) {
$this->status .= ' ' . $upload->shortUrl();
/* Do not call shortenlinks until the whole notice has been build */
}
// in Qvitter we shorten _before_ posting, so disble shortening here
$status_shortened = $this->status;

View File

@ -538,7 +538,8 @@ class QvitterAction extends ApiAction
#user-body #user-following:hover .label,
ul.stats a strong,
.queet-box-extras button,
#openid-login:hover:after {
#openid-login:hover:after,
.post-to-group {
color:/*COLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*COLOREND*/;
}
#unseen-notifications,
@ -574,7 +575,8 @@ class QvitterAction extends ApiAction
.inline-reply-queetbox,
span.inline-reply-caret,
.stream-item.expanded .stream-item.first-visible-after-parent,
#popup-faq #faq-container p.indent {
#popup-faq #faq-container p.indent,
.post-to-group {
border-color:/*LIGHTERBORDERCOLORSTART*/rgb(155,206,224)/*LIGHTERBORDERCOLOREND*/;
}
span.inline-reply-caret .caret-inner {

View File

@ -2773,6 +2773,32 @@ span.inline-reply-caret .caret-inner {
left: 13px;
}
.post-to-group {
background-color: rgba(255, 255, 255, 0.5);
border: 1px solid;
border-radius: 5px;
box-sizing: border-box;
font-size: 13px;
line-height: 20px;
margin: 0 0 7px;
padding: 3px 8px 3px 27px;
text-shadow: none;
width: 100%;
position: relative;
}
.post-to-group::before {
position: absolute;
display: block;
top: 0;
left: 0;
width:10px;
height:26px;
font-family: 'FontAwesome';
content:"\f0c0";
line-height:26px;
padding-left:7px;
}
#user-header {
border-top-left-radius: 6px;
border-top-right-radius: 6px;

View File

@ -1968,7 +1968,7 @@ function buildQueetHtml(obj, idInStream, extraClassesThisRun, requeeted_by, isCo
var in_groups_html = '';
if(typeof obj.statusnet_in_groups != 'undefined' && obj.statusnet_in_groups !== false && typeof obj.statusnet_in_groups === 'object') {
$.each(obj.statusnet_in_groups,function(){
in_groups_html = '<span class="in-groups"><a class="h-card group" href="' + obj.statusnet_in_groups.url + '">!' + obj.statusnet_in_groups.nickname + '</a></span>';
in_groups_html = in_groups_html + ' <span class="in-groups"><a class="h-card group" href="' + this.url + '">!' + this.nickname + '</a></span>';
});
}