summaryrefslogtreecommitdiff
path: root/plugins/YammerImport/yamdump.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/YammerImport/yamdump.php')
-rw-r--r--plugins/YammerImport/yamdump.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/plugins/YammerImport/yamdump.php b/plugins/YammerImport/yamdump.php
index 953b7d1a6..ad739760a 100644
--- a/plugins/YammerImport/yamdump.php
+++ b/plugins/YammerImport/yamdump.php
@@ -25,7 +25,36 @@ $data = $yam->messages();
// 2) we'll need to pull out all those referenced items too?
// 3) do we need to page over or anything?
-foreach ($data['messages'] as $message) {
- $notice = $imp->messageToNotice($message);
+// 20 qualifying messages per hit...
+// use older_than to grab more
+// (better if we can go in reverse though!)
+// meta: The older-available element indicates whether messages older than those shown are available to be fetched. See the older_than parameter mentioned above.
+
+foreach ($data['references'] as $item) {
+ if ($item['type'] == 'user') {
+ $user = $imp->prepUser($item);
+ var_dump($user);
+ } else if ($item['type'] == 'group') {
+ $group = $imp->prepGroup($item);
+ var_dump($group);
+ } else if ($item['type'] == 'tag') {
+ // could need these if we work from the parsed message text
+ // otherwise, the #blarf in orig text is fine.
+ } else if ($item['type'] == 'thread') {
+ // Shouldn't need thread info; we'll reconstruct conversations
+ // from the reply-to chains.
+ } else if ($item['type'] == 'message') {
+ // If we're processing everything, then we don't need the refs here.
+ } else {
+ echo "(skipping unknown ref: " . $item['type'] . ")\n";
+ }
+}
+
+// Process in reverse chron order...
+// @fixme follow paging
+$messages = $data['messages'];
+array_reverse($messages);
+foreach ($messages as $message) {
+ $notice = $imp->prepNotice($message);
var_dump($notice);
}