Commit Graph

640 Commits

Author SHA1 Message Date
Mikael Nordfeldth
414a95a784 Initial move towards microformats2
No validation has been attempted yet. Lots of changes left. This
is visibly not (very) different from the previous CSS layout. But
some simplifications have been made.

Might cause issues with local changes to themes and CSS. Also maybe
javascript which depends on certain legacy microformats elements.

The move to microformats2 is motivated by the announcement that all
microformats should be migrated to version 2, as of 2014-06-20 at:
http://microformats.org/2014/06/20/microformats-org-turns-9-upgrade-to-microformats2
2014-06-22 17:11:04 +02:00
Mikael Nordfeldth
a900d04052 Non-dynamic fetching for multiple Notice properties 2014-06-05 00:29:43 +02:00
Mikael Nordfeldth
3d807c812d $notice->getProfile will ALWAYS return a Profile
otherwise it throws an exception
2014-06-05 00:07:04 +02:00
Mikael Nordfeldth
04d4b62dff Replies to repeats should go to the original 2014-06-04 23:51:32 +02:00
Mikael Nordfeldth
a490d634db Repeats were not delivered a conversation ID
Vinilox noticed that replies to repeats ended up outside of the original
notice's conversations.
2014-06-04 23:21:37 +02:00
Mikael Nordfeldth
90cc6b4d3b Notice::getReplyTo more specific now (getInlineReplyTo) 2014-06-04 23:20:20 +02:00
Mikael Nordfeldth
629cbedee2 Dangerous non-dynamic profile fetching in Notice
For a Notice object with multiple results, ->getProfile() would ALWAYS
return the first profile in the list. For example our "popular notices"
stream ended up believing all notices were made by the same profile.
2014-06-03 12:22:07 +02:00
Mikael Nordfeldth
db443e9374 File::processNew now static and always throws exception on failure 2014-06-02 02:11:23 +02:00
Mikael Nordfeldth
49fa34e234 Make Profile::fromUri use UnknownUriException 2014-05-26 15:05:14 +02:00
Mikael Nordfeldth
e83b2e147a NoProfileException collision avoidance fix 2014-05-26 14:39:03 +02:00
Mikael Nordfeldth
b0cc9292b1 Notice->repeat() function takes Profile as argument now 2014-05-18 21:03:10 +02:00
Mikael Nordfeldth
c4c4835899 Notice->repeat should include the full message
Any clients showing the repeat itself should have its own shortening or
otherwise formatting rules which it can apply itself.
2014-05-18 20:53:44 +02:00
Mikael Nordfeldth
04b7194511 Notice->getUrl() for shares would throw exception in some feeds 2014-05-10 13:06:18 +02:00
Mikael Nordfeldth
27ed6b7db0 getConversationUrl introduced for linking to conversations 2014-05-01 15:25:19 +02:00
Mikael Nordfeldth
4774a25040 Link notice posted time to local representation
Notice class got a 'getLocalUrl' function.
2014-05-01 14:28:53 +02:00
Mikael Nordfeldth
7d191f8062 s/bestUrl/getUrl/ for notices and microapp objects 2014-04-29 19:46:58 +02:00
Mikael Nordfeldth
0883f54f62 getUrl replaces deprecated bestUrl (more to come) 2014-04-28 14:04:54 +02:00
Mikael Nordfeldth
72707ddc26 deprecate Notice::bestUrl() in favor of getUrl() 2014-04-20 15:28:31 +02:00
Mikael Nordfeldth
132be99506 Improve ShownoticeAction remote redirect code 2014-04-19 22:13:48 +02:00
Mikael Nordfeldth
2c1dcc7f14 Fixes to URI/URL handling for notices 2014-04-19 22:04:52 +02:00
Mikael Nordfeldth
85b022246f Handle missing URIs and URLs better 2014-04-18 23:36:01 +02:00
Mikael Nordfeldth
3e2136f222 Avoid double colon on Notice URI generation 2014-04-18 23:17:34 +02:00
Mikael Nordfeldth
e0e69ddd7c Throw exception when we can't get the url for a notice 2014-04-18 23:17:15 +02:00
Mikael Nordfeldth
28dc361a15 Set new notice uri to something that's not a URL 2014-04-18 22:42:01 +02:00
Mikael Nordfeldth
5842c59ba7 Get group attentions back into the "all" feed 2014-03-07 02:49:42 +01:00
Mikael Nordfeldth
5e4a275220 Clear Attentions when notice or profile is removed 2014-03-06 14:43:36 +01:00
Mikael Nordfeldth
2272cc244d Removed Inbox from core (unused since 4b2a66ed29)
Added the following FIXME:
How should a Twitter user get their Inbox filled with foreign tweets?

Every imported Twitter user has a profile in the Profile table, so we
could setup a Subscription entry for each of those, meaning they get
collected in the InboxNoticeStream... But this would mean a lot of
unnecessary entries and listings that generally just point to the
locked down Twitter service.

Let's figure out a good relation so we can connect any profile to any
imported foreign notice, so it shows up in the "all" feed.
2014-03-06 04:46:29 +01:00
Mikael Nordfeldth
da87e742f8 Treat author just as anyone else (Notice distrib) 2014-03-06 01:55:23 +01:00
Mikael Nordfeldth
00db57949f Always queue inbox distribution 2014-03-06 01:50:54 +01:00
Mikael Nordfeldth
f83b2cf324 Handle removed profile more gracefully in noticelist
Just hide it from the visitor, but log a warning (and error, since
the exception itself logs that).
2014-03-05 01:27:27 +01:00
Mikael Nordfeldth
5c505d8539 Conversation ID now gets set from initial notice.
This will work without much extra effort because there will always be
more notices (higher value) than conversations (so no collisions).

But please run upgrade.php to avoid having an autoincrement id on
conversation table.

Installations using code after 2014-03-01 will have identical
conversation IDs to the initial (conversation root) notice IDs. This
will not affect older installations, which will have very different
values.
2014-03-01 17:12:40 +01:00
Mikael Nordfeldth
edee39790e Use exceptions for Notice::getByUri
..jeez, a long time since I commited. Three in a row to get this right. Sorry :)
2014-01-12 22:46:50 +01:00
Mikael Nordfeldth
08dba7e21d Notice::getByUri is of course static 2014-01-12 22:41:30 +01:00
Mikael Nordfeldth
15c95dc415 getByUri added to Notice for future use 2014-01-12 22:37:41 +01:00
Mikael Nordfeldth
729c6eef36 Inbox class a bit more consistent in argument order and type 2013-11-09 01:18:44 +01:00
Mikael Nordfeldth
bd86519d50 Minor labeling things for StatusNet to GNU social migration 2013-11-01 14:04:40 +01:00
Mikael Nordfeldth
9b6633698c Group discovery from text functions polished
Also removed the entirely unused saveGroups function.

Now avoiding multiGet and using listFind in Profile->getGroups()
so we don't have to deal with ArrayWrapper.
2013-10-29 13:40:14 +01:00
Mikael Nordfeldth
2dfa0bfcee function delete in dataobjects now don't break strict syntax 2013-10-29 10:20:57 +01:00
Mikael Nordfeldth
23a6b4595f Reworked the ActivityContext->attention structure
Removing Evan's obscure attentionType solution and directly using the attention array
2013-10-28 22:21:14 +01:00
Mikael Nordfeldth
f99c4b7f07 More OOP-ish tests using instanceof 2013-10-28 22:18:00 +01:00
Mikael Nordfeldth
a5d8707658 Use getParent instead of manual reply_to lookup 2013-10-28 17:28:10 +01:00
Mikael Nordfeldth
340740266c Notice class local cache fixes 2013-10-23 12:33:37 +02:00
Mikael Nordfeldth
e274f69634 Notice->getParent function fixes
NoResultException was the wrong choice in this case, because it was
not a DB_DataObject instance that performed the search, but a static
call to the Notice class.
2013-10-22 15:37:19 +02:00
Mikael Nordfeldth
355c37bc3f Revert "Better ID for notice activity"
This reverts commit 8cc4660bd9.

This seems like something Evan only did to make pump.io import notices easier,
or maybe he just wanted to get rid of the identi.ca URLs?
2013-10-21 23:25:35 +02:00
Mikael Nordfeldth
f4c0cff032 Only use ActivityVerb::SHARE (forwardId is deprecated)
StatusNet >= 1.0 support it.
2013-10-21 22:25:19 +02:00
Mikael Nordfeldth
df5aa6f93a Exception wasn't thrown. How does PHP handle daisychained calls, really? 2013-10-21 09:09:32 +02:00
Mikael Nordfeldth
e868ebfe77 WebFingerResource introduced, instead of strict Profile object
This is the beginning of getting notice URI info via WebFinger

*XrdActionLinks is renamed *WebFingerProfileLinks, check EVENTS.txt
in WebFinger plugin for new events.
2013-10-20 15:48:14 +02:00
Mikael Nordfeldth
34a6624452 Qvitter API changes (thanks hannes2peer)
I implemented changes from quitter.se's new API that their front-end qvitter
uses, https://github.com/hannesmannerheim/qvitter/blob/master/api-changes-1.1.1/CHANGES

However I left out the URL shortening commens, since I believe whatever behaviour
they experienced that caused them to implement this was a bug (or many) and should
be fixed in their proper areas and that shortening should not be entirely left
out in API calls.
2013-10-06 21:51:50 +02:00
Mikael Nordfeldth
e376905d93 Forgot to clean some debug logging 2013-10-05 14:33:02 +02:00
Mikael Nordfeldth
29de09a63d getParent throws exception
Should we get another Exception for if there's no parent? I think so,
because it's not really the same context as 'no result'.
2013-10-05 12:30:14 +02:00
Mikael Nordfeldth
39f43e415d Do not name anything getOriginal (because DB_DataObject calls that)
Avatar->getOriginal has been renamed getUploaded
Notice->getOriginal has been renamed getParent
2013-10-02 15:01:11 +02:00
Joshua Judson Rosen
8e53eb2b4c Correct a logic-inverting typo in handling of replies to group-posts.
The typo causes a tautology, which makes replies to group-posts always (or almost-always) go to the group(s).
cf. http://status.net/open-source/issues/3638
2013-09-29 23:14:00 +02:00
Mikael Nordfeldth
747fe9d59b Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was
in the (un)subscribe start/end event handlers, which resulted in making the
Subscription class a bit stricter, regarding ::start and ::cancel at least.
Several minor fixes in many files were made due to this.

This does NOT touch the Foreign_link function, which should also have a more
strict getUser call. That is a future project.
2013-09-09 23:03:34 +02:00
Mikael Nordfeldth
79e3acf0f0 Moved multiGet into Managed_DataObject 2013-08-29 10:38:11 +02:00
Mikael Nordfeldth
b3e61ce7d0 Stronger typing, require array where param array 2013-08-29 10:27:39 +02:00
Mikael Nordfeldth
fac7371179 pivotGet moved into Managed_DataObject 2013-08-29 10:13:07 +02:00
Mikael Nordfeldth
97ce71e55d Managed_DataObject now has listGet for all classes 2013-08-18 21:02:33 +02:00
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Mikael Nordfeldth
1a9a8ea730 staticGet for sub-Managed_DataObject classes now calls parent
The parent class for our database objects, Managed_DataObject, has a
dynamically assigned class in staticGet which objects get put into,
leaving us with less code to do the same thing.

We will probably have to move away from the DB_DataObject 'staticGet'
call as it is nowadays deprecated.
2013-08-12 19:46:44 +02:00
Evan Prodromou
8cc4660bd9 Better ID for notice activity 2013-06-15 12:07:52 -04:00
Evan Prodromou
08eca420ca Add generator to JSON output 2013-06-07 11:35:06 -04:00
Evan Prodromou
6164940e8c Some better context for notices as arrays 2013-06-07 03:11:23 -04:00
Evan Prodromou
7229533b0f Use real attachments for JSON output 2013-06-05 09:39:43 -04:00
Evan Prodromou
15d466ebe6 Don't add content as title for notes 2013-06-04 19:53:07 -04:00
Evan Prodromou
c5ef1e661e By default Notice::asActivity has a null argument 2013-04-14 12:02:52 -04:00
Evan Prodromou
6f424eb80f If there's an exception in notice distribution, continue 2012-11-25 10:39:49 -05:00
Evan Prodromou
acf52a3041 Hide stuff if there's an exception getting the profile 2012-05-04 23:37:12 -04:00
Evan Prodromou
5f2b62927c let author see own spam 2012-04-23 21:25:53 -04:00
Evan Prodromou
4746016dd5 Don't convert deleted notices into repeats in Notice::asActivity() 2012-04-23 19:15:12 -04:00
Evan Prodromou
04ad0838be Add spam-training, spam-reviewing rights
Replaced the check for a moderator role in certain spam-training and
-reviewing points. Make sure modhelpers can check, too.
2012-03-25 13:18:16 -04:00
Evan Prodromou
3e46a9b164 Make blocks work for non-subscription deliveries 2012-03-23 12:55:51 -04:00
Evan Prodromou
d98a4be24e Merge branch '1.0.x' 2012-03-21 16:40:51 -04:00
Evan Prodromou
1c625bd040 show correct conversation notice count 2012-03-21 16:40:42 -04:00
Evan Prodromou
8706d8d351 double-check profile 2012-03-21 13:05:15 -04:00
Evan Prodromou
ad1649e4ba Pass profile down to spam-hiding function 2012-03-21 13:02:45 -04:00
Evan Prodromou
d942072a6c Optionally hide spam from timelines
For sites with a lot of spam, this will hide that spam from timelines for everyone but moderators.
2012-03-21 10:26:00 -04:00
Evan Prodromou
d2d75823a4 Use this for scope check 2012-03-20 21:13:35 -04:00
Evan Prodromou
b65db93d29 New events for overriding scope checks 2012-03-20 16:39:43 -04:00
Evan Prodromou
499e7d7c41 Squashed commit of the following:
commit 74c5e4cce42ae601c07b447e100f097c15ebf9d2
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 12:48:52 2011 -0400

    Add back in some optimization indices lost in schema conversion

commit ef5c2acfcd123b25910a1c8bb4ae01a3f9608e5e
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 12:29:57 2011 -0400

    restore some of the lost optimized indices on notice table
2011-10-20 12:50:39 -04:00
Evan Prodromou
a28a6d2f72 fixup bad class constant in Notice 2011-09-19 16:11:43 -04:00
Evan Prodromou
48625da04b Automatically add or drop fulltext indexes 2011-09-18 18:28:44 -04:00
Zach Copley
3bf3b6686c Remove fulltext indexes from notice and profile tables. The default
for fulltext search is 'like' (MySQLLikeSearch) which doesn't require
them.
2011-09-18 14:17:41 -07:00
Evan Prodromou
a740556e3f is_int() -> \!is_null() 2011-09-08 13:05:17 -04:00
Evan Prodromou
5680eb74d0 default scope value is null, determined by site/private 2011-09-08 12:38:11 -04:00
Evan Prodromou
9948523c33 Merge branch 'master' into testing 2011-09-08 09:03:33 -04:00
Dan Scott
db9ac1a531 Issue #546: enable case-insensitive searching in MySQL
MySQL needs the collation utf8_general_ci to support case-insensitive
searching. lib/mysqlschema.php already supports a 'collate' attribute on
a per-column basis, so we just need to take advantage of that attribute
on the columns we want to search and Bob (and BOB, and bOB) is your
uncle.

Signed-off-by: Dan Scott <dan@coffeecode.net>
2011-08-27 16:36:58 -04:00
Evan Prodromou
4f86e05d03 wrap use of repeated element in existence check 2011-08-27 10:02:11 -04:00
Zach Copley
307a75e3a7 Fix deprecated call-time pass by references 2011-08-23 09:52:48 -07:00
Zach Copley
1507c32454 Fix warnings - function arguments should expect values instead of references 2011-08-23 09:49:32 -07:00
Evan Prodromou
5c3bc19968 Re-add lost verb column for Notice 2011-08-23 11:42:18 -04:00
Evan Prodromou
be4d9082f9 Merge branch '1.0.x' into activity 2011-08-23 00:41:03 -04:00
Evan Prodromou
2ea17b0749 use references for Notice::_setFaves() and Notice::_setRepeats() 2011-08-23 00:40:54 -04:00
Evan Prodromou
01c2c31c1e Merge branch '1.0.x' into activity
Conflicts:
	db/core.php
2011-08-22 18:13:02 -04:00
Evan Prodromou
9ca3c3d1c3 move core schema to class files 2011-08-22 17:52:02 -04:00
Evan Prodromou
48bb784400 add a verb column to the notice table 2011-08-22 16:02:14 -04:00
Evan Prodromou
2f1751568a pre-fill repeats of notices 2011-08-22 12:39:37 -04:00
Evan Prodromou
d3399e93e8 use listGet() for ConversationNoticeStream 2011-08-22 12:25:04 -04:00
Evan Prodromou
ac268773bf Pass correct notice id to Memcached_DataObject::listGet() in getFaves() 2011-08-08 12:01:39 -04:00
Evan Prodromou
16042387a0 pre-fill the addressees of notices in a list 2011-08-03 00:59:09 -04:00
Evan Prodromou
ba6235a446 Get faves in Notice and pre-fill 2011-08-03 00:04:18 -04:00