aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2015-09-04 12:24:52 +0200
committerzottel <github@zottel.net>2015-09-04 12:24:52 +0200
commit938ef930d4b7353cc4e3c1f9dac015e91b96667b (patch)
treec36e6797853b230ee6311bc8295bce56b13dbcbb
parent015c7243b9b688acda9c1defce9055fe2c3c2e61 (diff)
parentb1888afa108fb09d0ebe3d50cc70ee9024ea76f1 (diff)
downloadvolse-hubzilla-938ef930d4b7353cc4e3c1f9dac015e91b96667b.tar.gz
volse-hubzilla-938ef930d4b7353cc4e3c1f9dac015e91b96667b.tar.bz2
volse-hubzilla-938ef930d4b7353cc4e3c1f9dac015e91b96667b.zip
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-xboot.php2
-rw-r--r--doc/bugs.bb31
-rw-r--r--doc/members.bb1
-rw-r--r--include/chat.php2
-rw-r--r--include/identity.php19
-rw-r--r--include/import.php99
-rw-r--r--include/zot.php3
-rw-r--r--install/update.php28
-rw-r--r--mod/chat.php4
-rw-r--r--mod/import.php8
-rw-r--r--version.inc2
11 files changed, 174 insertions, 25 deletions
diff --git a/boot.php b/boot.php
index e7ed7dcee..4dafde7f2 100755
--- a/boot.php
+++ b/boot.php
@@ -50,7 +50,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'H');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1151 );
+define ( 'DB_UPDATE_VERSION', 1152 );
/**
* @brief Constant with a HTML line break.
diff --git a/doc/bugs.bb b/doc/bugs.bb
new file mode 100644
index 000000000..9fefdef08
--- /dev/null
+++ b/doc/bugs.bb
@@ -0,0 +1,31 @@
+[h2]Bugs, Issues, and things that go bump in the night...[/h2]
+
+[h3]Something went wrong! Who is charge of fixing it?[/h3]
+
+This software is open source and was built by and is maintained by unpaid volunteers. So the quick answer is that nobody is in charge of fixing things. However, some of us have worked long and hard to provide a quality experience for you and don't wish to see you in discomfort because of a software issue or bug.
+
+The first thing you need to do is talk to your hub administrator - the person who runs and manages your site. They are in the unique position of having access to the internal software and database and [b]logfiles[/b] and will need to be involved in fixing your problem. Other people "on the net" can't really help with this. The first thing [b]they[/b] need to do is look at their logs and/or try to reproduce the problem. So try to be as helpful and courteous as possible in helping them look into the problem.
+
+To find your site administrator (if you don't know who they are) please look at [url=[baseurl]/siteinfo]this page[/url]. If they have not provided any contact info on that page or provided an "Impressum" there, see [url=[baseurl]/siteinfo/json]this site info summary[/url] under the heading "admin:".
+
+[h3]I'm a site administrator; what do I do?[/h3]
+
+It's your site, fix it! OK, sometimes it isn't that easy. There could be other sites involved, and the problem may not even be on your site but elsewhere in the network. Try to pin down the communication endpoints (hubs or sites) involved in the problem and contact the administrator of that site or those sites. Please try and provide an event time of when things went wrong so it can be found in the logs. Work with the other administrator(s) to find the cause of the problem. Logfiles are your friend. When something happens in the software that we didn't expect, it is nearly always logged.
+
+[h3]The white screen of death[/h3]
+
+If you get a blank white screen when doing something, this is almost always a code or syntax error. There are instructions in your .htconfig.php file for enabling syntax logging. Do this and repeat the sequence which led to the error and it should log the offending line of code. Hopefully you will be able to fix the problem with this information. When you do, please submit the fix "upstream" so that we can share the fix with the rest of the project members. This is the key benefit of using open source software - we share with each other and everybody benefits.
+
+[h3]I'm stumped. I can't figure out what is wrong.[/h3]
+
+At this point it might be worthwhile discussing the issue on one of the online forums. There may be several of these and some may be more suited to your spoken language. As a last resort, try "Channel One", which is in English.
+
+Other developers may need to find out more, so do your homework and document what is happening and everything you've tried. Don't say "I did xyz and it didn't work." That doesn't tell us anything. Tell us precisely what steps you took and what you expected the result to be, and precisely what happened as a result. If there were any error messages, don't say "there was an error message". Tell us exactly what the message said.
+
+If the project developers can't help you right away, understand that they are volunteers and may have a lot of other work and demands on their time. At this point you need to file a bug report. You will need an account on github.com to do this. So register, and then visit https://github.com/redmatrix/hubzilla/issues
+. Create an issue here and provide all the same information that you provided online. Don't leave out anything.
+
+Then you wait. If it's a high profile issue, it may get fixed quickly. But nobody is in charge of fixing bugs. If it lingers without resolution, please spend some more time investigating the problem. Ask about anything you don't understand related to the behaviour. You will learn more about how the software works and quite possibly figure out why it isn't working now. Ultimately it is somebody in the community who is going to fix this and you are a member of the community; and this is how the open source process works.
+
+And just a word of warning. If you file 10 or 20 or 40 bugs on your first day looking at the project and without exploring how the software was supposed to work in the first place, you will probably be ignored. This is a public project and we are unfortunately frequented by "whingers" who like to waste our time complaining about stuff. Don't be one of them. The more helpful and courteous you are, the more helpful and courteous we will be in return. This applies to everything you do in life and is only mentioned here as a reminder.
+ \ No newline at end of file
diff --git a/doc/members.bb b/doc/members.bb
index 705154b56..13339ef2d 100644
--- a/doc/members.bb
+++ b/doc/members.bb
@@ -22,3 +22,4 @@
[zrl=[baseurl]/help/addons]Help With Addons[/zrl]
[zrl=[baseurl]/help/diaspora_compat]Diaspora Communications Compatibility (Diaspora and Friendica)[/zrl]
[zrl=[baseurl]/help/faq_members]FAQ For Members[/zrl]
+[zrl=[baseurl]/help/bugs]Bugs, Issues, and things that go bump in the night...[/zrl]
diff --git a/include/chat.php b/include/chat.php
index 05bb02bb9..a0646265a 100644
--- a/include/chat.php
+++ b/include/chat.php
@@ -91,6 +91,8 @@ function chatroom_destroy($channel,$arr) {
return $ret;
}
+ create_sync_packet($channel['channel_id'],array('chatroom' => $r));
+
q("delete from chatroom where cr_id = %d",
intval($r[0]['cr_id'])
);
diff --git a/include/identity.php b/include/identity.php
index 115baddc1..393378cc4 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -566,13 +566,18 @@ function identity_basic_export($channel_id, $items = false) {
if($r)
$ret['obj'] = $r;
-
$r = q("select * from app where app_channel = %d",
intval($channel_id)
);
if($r)
$ret['app'] = $r;
+ $r = q("select * from chatroom where cr_uid = %d",
+ intval($channel_id)
+ );
+ if($r)
+ $ret['chatroom'] = $r;
+
if(! $items)
return $ret;
@@ -594,14 +599,17 @@ function identity_basic_export($channel_id, $items = false) {
/** @warning this may run into memory limits on smaller systems */
- /** export one year of posts. If you want to export and import all posts you have to start with
+
+ /** export three months of posts. If you want to export and import all posts you have to start with
* the first year and export/import them in ascending order.
+ *
+ * Don't export linked resource items. we'll have to pull those out separately.
*/
- $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created > %s - INTERVAL %s",
+ $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created > %s - INTERVAL %s and resource_type = '' order by created",
intval($channel_id),
db_utcnow(),
- db_quoteinterval('1 YEAR')
+ db_quoteinterval('3 MONTH')
);
if($r) {
$ret['item'] = array();
@@ -635,7 +643,7 @@ function identity_export_year($channel_id,$year,$month = 0) {
else
$maxdate = datetime_convert('UTC','UTC',$year+1 . '-01-01 00:00:00');
- $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' order by created",
+ $r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' and resource_type = '' order by created",
intval($channel_id),
dbesc($mindate),
dbesc($maxdate)
@@ -649,7 +657,6 @@ function identity_export_year($channel_id,$year,$month = 0) {
$ret['item'][] = encode_item($rr,true);
}
-
$r = q("select item_id.*, item.mid from item_id left join item on item_id.iid = item.id where item_id.uid = %d
and item.created >= '%s' and item.created < '%s' order by created ",
intval($channel_id),
diff --git a/include/import.php b/include/import.php
index 6ce572ea2..261219ce0 100644
--- a/include/import.php
+++ b/include/import.php
@@ -349,7 +349,7 @@ function sync_apps($channel,$apps) {
intval($channel['channel_id'])
);
if($x) {
- if($x[0]['app_edited'] >= $obj['app_edited'])
+ if($x[0]['app_edited'] >= $app['app_edited'])
continue;
$exists = true;
}
@@ -377,4 +377,99 @@ function sync_apps($channel,$apps) {
}
}
}
-} \ No newline at end of file
+}
+
+
+
+function import_chatrooms($channel,$chatrooms) {
+
+ if($channel && $chatrooms) {
+ foreach($chatrooms as $chatroom) {
+
+ if(! $chatroom['cr_name'])
+ continue;
+
+ unset($chatroom['cr_id']);
+ unset($chatroom['cr_aid']);
+ unset($chatroom['cr_uid']);
+
+ $chatroom['cr_aid'] = $channel['channel_account_id'];
+ $chatroom['cr_uid'] = $channel['channel_id'];
+
+ dbesc_array($chatroom);
+ $r = dbq("INSERT INTO chatroom (`"
+ . implode("`, `", array_keys($chatroom))
+ . "`) VALUES ('"
+ . implode("', '", array_values($chatroom))
+ . "')"
+ );
+ }
+ }
+}
+
+
+
+function sync_chatrooms($channel,$chatrooms) {
+
+ if($channel && $chatrooms) {
+ foreach($chatrooms as $chatroom) {
+
+ if(! $chatroom['cr_name'])
+ continue;
+
+ if(array_key_exists('cr_deleted',$chatroom) && $chatroom['cr_deleted']) {
+ q("delete from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
+ dbesc($chatroom['cr_name']),
+ intval($channel['channel_id'])
+ );
+ continue;
+ }
+
+
+ unset($chatroom['cr_id']);
+ unset($chatroom['cr_aid']);
+ unset($chatroom['cr_uid']);
+
+ if(! $chatroom['cr_created'] || $chatroom['cr_created'] === NULL_DATE)
+ $chatroom['cr_created'] = datetime_convert();
+ if(! $chatroom['cr_edited'] || $chatroom['cr_edited'] === NULL_DATE)
+ $chatroom['cr_edited'] = datetime_convert();
+
+ $chatroom['cr_aid'] = $channel['channel_account_id'];
+ $chatroom['cr_uid'] = $channel['channel_id'];
+
+ $exists = false;
+
+ $x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
+ dbesc($chatroom['cr_name']),
+ intval($channel['channel_id'])
+ );
+ if($x) {
+ if($x[0]['cr_edited'] >= $chatroom['cr_edited'])
+ continue;
+ $exists = true;
+ }
+ $name = $chatroom['cr_name'];
+
+ if($exists) {
+ foreach($chatroom as $k => $v) {
+ $r = q("UPDATE chatroom SET `%s` = '%s' WHERE cr_name = '%s' AND cr_uid = %d",
+ dbesc($k),
+ dbesc($v),
+ dbesc($name),
+ intval($channel['channel_id'])
+ );
+ }
+ }
+ else {
+ dbesc_array($chatroom);
+ $r = dbq("INSERT INTO chatroom (`"
+ . implode("`, `", array_keys($chatroom))
+ . "`) VALUES ('"
+ . implode("', '", array_values($chatroom))
+ . "')"
+ );
+ }
+ }
+ }
+}
diff --git a/include/zot.php b/include/zot.php
index fecaa7ad2..9610df894 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -2881,6 +2881,9 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(array_key_exists('app',$arr) && $arr['app'])
sync_apps($channel,$arr['app']);
+ if(array_key_exists('chatroom',$arr) && $arr['chatroom'])
+ sync_apps($channel,$arr['chatroom']);
+
if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) {
if(array_key_exists('channel_page_flags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) {
$arr['channel']['channel_removed'] = (($arr['channel']['channel_pageflags'] & 0x8000) ? 1 : 0);
diff --git a/install/update.php b/install/update.php
index 8e531b595..339d0cb25 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1151 );
+define( 'UPDATE_VERSION' , 1152 );
/**
*
@@ -1733,16 +1733,6 @@ function update_r1148() {
$r1 = q("alter table likes add i_mid char(255) not null default '' ");
$r2 = q("create index i_mid on likes ( i_mid ) ");
- $r3 = q("select likes.*, item.mid from from likes left join item on likes.iid = item.id");
- if($r3) {
- foreach($r3 as $rr) {
- q("update likes set i_mid = '%s' where id = $d",
- dbesc($rr['mid']),
- intval($rr['id'])
- );
- }
- }
-
if($r1 && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
@@ -1798,3 +1788,19 @@ function update_r1150() {
}
+function update_r1151() {
+
+ $r3 = q("select likes.*, item.mid from likes left join item on likes.iid = item.id");
+ if($r3) {
+ foreach($r3 as $rr) {
+ q("update likes set i_mid = '%s' where id = $d",
+ dbesc($rr['mid']),
+ intval($rr['id'])
+ );
+ }
+ }
+
+
+ return UPDATE_SUCCESS;
+
+}
diff --git a/mod/chat.php b/mod/chat.php
index c2c11d0ab..9ad58bc32 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -62,11 +62,13 @@ function chat_post(&$a) {
chatroom_create($channel,$arr);
- $x = q("select cr_id from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
+ $x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
dbesc($room),
intval(local_channel())
);
+ create_sync_packet(0, array('chatroom' => $x));
+
if($x)
goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']);
diff --git a/mod/import.php b/mod/import.php
index c2ed82a0a..1d1799e00 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -161,7 +161,6 @@ function import_post(&$a) {
}
-
if($completed < 3) {
if($data['photo']) {
@@ -169,8 +168,8 @@ function import_post(&$a) {
import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],get_account_id(),$channel['channel_id']);
}
- if(is_array($data['profiles']))
- import_profiles($channel,$data['profiles']);
+ if(is_array($data['profile']))
+ import_profiles($channel,$data['profile']);
logger('import step 3');
$_SESSION['import_step'] = 3;
@@ -436,6 +435,9 @@ function import_post(&$a) {
if(is_array($data['app']))
import_apps($channel,$data['app']);
+ if(is_array($data['chatroom']))
+ import_chatrooms($channel,$data['chatroom']);
+
$saved_notification_flags = notifications_off($channel['channel_id']);
if($import_posts && array_key_exists('item',$data) && $data['item']) {
diff --git a/version.inc b/version.inc
index da2499cde..9cfd95d30 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2015-09-02.1143
+2015-09-03.1144