aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-29 18:01:51 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-29 18:01:51 -0700
commit6e8ad5089e3aeea6377718db91ccf48284a315fa (patch)
tree41cfeac8c0e80a135bdb10e9631519b8b2dd3225
parent63f2e9b41259975f1af6415cda01dc0f81b1af30 (diff)
parent2072ea721fa26b8e5f7dd4067434951b738de92b (diff)
downloadvolse-hubzilla-6e8ad5089e3aeea6377718db91ccf48284a315fa.tar.gz
volse-hubzilla-6e8ad5089e3aeea6377718db91ccf48284a315fa.tar.bz2
volse-hubzilla-6e8ad5089e3aeea6377718db91ccf48284a315fa.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts: view/nl/messages.po view/nl/strings.php
-rw-r--r--include/network.php90
-rw-r--r--include/notifier.php11
-rw-r--r--install/schema_mysql.sql1
-rw-r--r--mod/directory.php3
-rw-r--r--version.inc2
-rw-r--r--view/theme/redbasic/css/style.css6
-rwxr-xr-xview/tpl/direntry.tpl4
7 files changed, 110 insertions, 7 deletions
diff --git a/include/network.php b/include/network.php
index fb336fbb4..f331da488 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1568,3 +1568,93 @@ function service_plink($contact, $guid) {
return $plink;
}
+
+
+function format_and_send_email($sender,$xchan,$item) {
+
+ require_once('include/enotify.php');
+
+ $title = $item['title'];
+ $body = $item['body'];
+
+ $textversion = strip_tags(html_entity_decode(bbcode(str_replace(array("\\r", "\\n"), array( "", "\n"), $body)),ENT_QUOTES,'UTF-8'));
+
+ $htmlversion = bbcode(str_replace(array("\\r","\\n"), array("","<br />\n"),$body));
+
+ $banner = t('$Projectname Notification');
+ $product = t('$projectname'); // PLATFORM_NAME;
+ $siteurl = z_root();
+ $thanks = t('Thank You,');
+ $sitename = get_config('system','sitename');
+ $site_admin = sprintf( t('%s Administrator'), $sitename);
+
+ // load the template for private message notifications
+ $tpl = get_markup_template('email_notify_html.tpl');
+ $email_html_body = replace_macros($tpl,array(
+ '$banner' => $banner,
+ '$product' => $product,
+ '$preamble' => '',
+ '$sitename' => $sitename,
+ '$siteurl' => $siteurl,
+ '$source_name' => $sender['xchan_name'],
+ '$source_link' => $sender['xchan_url'],
+ '$source_photo' => $sender['xchan_photo_m'],
+ '$username' => $xchan['xchan_name'],
+ '$hsitelink' => $datarray['hsitelink'],
+ '$hitemlink' => $datarray['hitemlink'],
+ '$thanks' => $thanks,
+ '$site_admin' => $site_admin,
+ '$title' => $title,
+ '$htmlversion' => $htmlversion,
+ ));
+
+ // load the template for private message notifications
+ $tpl = get_markup_template('email_notify_text.tpl');
+ $email_text_body = replace_macros($tpl, array(
+ '$banner' => $banner,
+ '$product' => $product,
+ '$preamble' => '',
+ '$sitename' => $sitename,
+ '$siteurl' => $siteurl,
+ '$source_name' => $sender['xchan_name'],
+ '$source_link' => $sender['xchan_url'],
+ '$source_photo' => $sender['xchan_photo_m'],
+ '$username' => $xchan['xchan_name'],
+ '$hsitelink' => $datarray['hsitelink'],
+ '$hitemlink' => $datarray['hitemlink'],
+ '$thanks' => $thanks,
+ '$site_admin' => $site_admin,
+ '$title' => $title,
+ '$textversion' => $textversion
+ ));
+
+ $sender_name = t('Administrator');
+
+ $hostname = get_app()->get_hostname();
+ if(strpos($hostname,':'))
+ $hostname = substr($hostname,0,strpos($hostname,':'));
+ $sender_email = 'noreply' . '@' . $hostname;
+
+ // use the EmailNotification library to send the message
+
+ enotify::send(array(
+ 'fromName' => $product,
+ 'fromEmail' => $sender_email,
+ 'replyTo' => $sender_email,
+ 'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']),
+ 'messageSubject' => (($title) ? $title : t('No Subject')),
+ 'htmlVersion' => $email_html_body,
+ 'textVersion' => $email_text_body,
+ 'additionalMailHeader' => '',
+ ));
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/include/notifier.php b/include/notifier.php
index 7dcf1b5a2..e4cfbd85d 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -354,7 +354,7 @@ function notifier_run($argv, $argc){
return;
}
- $s = q("select * from channel where channel_id = %d limit 1",
+ $s = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
intval($target_item['uid'])
);
if($s)
@@ -505,6 +505,15 @@ function notifier_run($argv, $argc){
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
if($private)
$env_recips[] = array('guid' => $d['xchan_guid'],'guid_sig' => $d['xchan_guid_sig'],'hash' => $d['xchan_hash']);
+
+ if($d['xchan_network'] === 'mail' && $normal_mode) {
+ $delivery_options = get_xconfig($d['xchan_hash'],'system','delivery_mode');
+ if(! $delivery_options)
+ format_and_send_email($channel,$d,$target_item);
+ }
+
+
+
}
}
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index e30eded29..b1d59a0f5 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -703,6 +703,7 @@ CREATE TABLE IF NOT EXISTS `mail` (
`channel_id` int(10) unsigned NOT NULL DEFAULT '0',
`title` text NOT NULL,
`body` mediumtext NOT NULL,
+ `sig` text NOT NULL,
`attach` mediumtext NOT NULL,
`mid` char(255) NOT NULL DEFAULT '',
`parent_mid` char(255) NOT NULL DEFAULT '',
diff --git a/mod/directory.php b/mod/directory.php
index 5220c1e3e..f01efc053 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -210,7 +210,7 @@ function directory_content(&$a) {
$location .= $rr['region'];
}
if(strlen($rr['country'])) {
- if(strlen($details))
+ if(strlen($location))
$location .= ', ';
$location .= $rr['country'];
}
@@ -286,7 +286,6 @@ function directory_content(&$a) {
'hash' => $rr['hash'],
'alttext' => $rr['name'] . ((local_channel() || remote_channel()) ? ' ' . $rr['address'] : ''),
'name' => $rr['name'],
- 'details' => $details,
'age' => $age,
'age_label' => t('Age:'),
'profile' => $profile,
diff --git a/version.inc b/version.inc
index b06ac504d..14dff2773 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2015-06-28.1077
+2015-06-29.1078
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 540f691c6..fcc089cf0 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1559,6 +1559,11 @@ th,td {
padding: 3px;
}
+#channels > tbody > tr > td, #users > tbody > tr > td {
+ max-width: 19.4em;
+ overflow: hidden;
+}
+
/* message */
img.mail-list-sender-photo {
@@ -2003,7 +2008,6 @@ nav .badge.mail-update:hover {
.dropdown-menu {
font-size: $body_font_size;
border-radius: $radiuspx;
- max-width: 100%;
}
.dropdown-menu img {
diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl
index 98ec25e23..6407f1edd 100755
--- a/view/tpl/direntry.tpl
+++ b/view/tpl/direntry.tpl
@@ -41,9 +41,9 @@
</div>
{{/if}}
- {{if $entry.details}}
+ {{if $entry.location}}
<div class="contact-info-element">
- <span class="contact-info-label">{{$entry.location}}</span> {{$entry.details}}
+ <span class="contact-info-label">{{$entry.location_label}}</span> {{$entry.location}}
</div>
{{/if}}