]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add tags on creation of notices and users
authorEvan Prodromou <evan@prodromou.name>
Thu, 22 May 2008 18:55:00 +0000 (14:55 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 22 May 2008 18:55:00 +0000 (14:55 -0400)
darcs-hash:20080522185500-84dde-39a66d36d2c80ff57e2ab2d0274548770c4d06f7.gz

actions/newnotice.php
actions/register.php
lib/util.php

index 535b1a512dde8fd72d3274cb31b64693c211d303..b2c513733d4dd2876e5babd772734b6b11372966 100644 (file)
@@ -55,13 +55,22 @@ class NewnoticeAction extends Action {
 
                $id = $notice->insert();
                
-               if ($id) {
-                       common_broadcast_notices($id);
-                       common_redirect(common_local_url('shownotice',
-                                                                                        array('notice' => $id)), 303);
-               } else {
+               if (!$id) {
+                       common_server_error(_t('Problem saving notice.'));
+                       return;
+               }
+
+               $orig = clone($notice);
+               $notice->uri = common_mint_tag('notice:' . $id);
+               
+               if (!$notice->update($orig)) {
                        common_server_error(_t('Problem saving notice.'));
+                       return;
                }
+               
+               common_broadcast_notice($notice);
+               common_redirect(common_local_url('shownotice',
+                                                                                array('notice' => $id)), 303);
        }
 
        function show_form($msg=NULL) {
index c67235f9d8d8d2e618a67764f54e459c15ca5376..fc729a29bfbb819bc4f0992ff8e3b9146fc65b2c 100644 (file)
@@ -103,7 +103,8 @@ class RegisterAction extends Action {
                $user->password = common_munge_password($password, $id);
                $user->email = $email;
                $user->created =  DB_DataObject_Cast::dateTime(); # current time
-
+               $user->uri = common_mint_tag('user:'.$id);
+               
                $result = $user->insert();
                if (!$result) {
                        # Try to clean up...
index 9057382dbaa2e7b0d0e408307ed38adff5707c81..64fa230d201b7bd75122352557d338663a2d25d3 100644 (file)
@@ -411,7 +411,7 @@ function common_redirect($url, $code=307) {
        common_element('a', array('href' => $url), $url);
 }
 
-function common_broadcast_notices($id) {
+function common_broadcast_notice($notice) {
        // XXX: broadcast notices to remote subscribers
        // XXX: broadcast notices to SMS
        // XXX: broadcast notices to Jabber