New patches: [reply to any message Ben McDonald **20080723194246] { hunk ./actions/newnotice.php 22 -class NewnoticeAction extends Action { +require_once(INSTALLDIR.'/lib/stream.php'); + +class NewnoticeAction extends StreamAction { hunk ./actions/newnotice.php 76 - common_save_replies($notice); + $reply_id = $this->trimmed('reply_id'); + if ($reply_id) { + common_save_reply($notice, $reply_id); + } else { + common_save_replies($notice); + } hunk ./actions/newnotice.php 102 - $replyto = $this->trimmed('replyto'); - $profile = Profile::staticGet('nickname', $replyto); - if ($profile) { - $content = '@' . $profile->nickname . ' '; + $reply_id = $this->trimmed('replyto'); + if ($reply_id) { + $notice = Notice::staticGet($reply_id); + $profile = $notice->getProfile(); + if ($profile) { + $content = $profile->nickname; + } hunk ./actions/newnotice.php 111 + + $content = array('name' => $content, + 'id' => $reply_id); + hunk ./actions/newnotice.php 120 + + if ($notice) { + common_element_start('ul', array('id' => 'notices')); + $this->show_notice($notice); + common_element_end('ul'); + } + hunk ./actions/showstream.php 396 - array('replyto' => $profile->nickname)), - 'onclick' => 'doreply("'.$profile->nickname.'"); return false', + array('replyto' => $notice->id)), hunk ./lib/stream.php 104 - array('replyto' => $profile->nickname)), - 'onclick' => 'doreply("'.$profile->nickname.'"); return false', + array('replyto' => $notice->id)), hunk ./lib/util.php 884 +function common_save_reply($notice, $replyto) { + if (!$replyto) { + return true; + } + + $sender = Profile::staticGet($notice->profile_id); + $relpynotice = Notice::staticGet($replyto); + $relpyprofile = $relpynotice->getProfile(); + $nickname = $relpyprofile->nickname; + + $recipient = common_relative_profile($sender, $nickname, $notice->created); + if (!$recipient) { + continue; + } + if ($recipient->id != $sender->id) { # Don't save reply to self + $orig = clone($notice); + $notice->reply_to = $replyto; + $notice->update($orig); + } + $reply = new Reply(); + $reply->notice_id = $notice->id; + $reply->profile_id = $recipient->id; + $id = $reply->insert(); + if (!$id) { + $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); + common_log(LOG_ERR, 'DB error inserting reply: ' . $last_error->message); + common_server_error(sprintf(_('DB error inserting reply: %s'), $last_error->message)); + return; + } +} + hunk ./lib/util.php 1026 + if (!$content['id']) { + $message = sprintf(_('What\'s up, %s?'), $user->nickname); + } else { + $message = sprintf(_('Reply to, %s?'), $content['name']); + $content['name'] = '@' . $content['name'] . ' '; + } hunk ./lib/util.php 1039 - sprintf(_('What\'s up, %s?'), $user->nickname)); + $message); hunk ./lib/util.php 1045 - ($content) ? $content : ''); + ($content['name']) ? $content['name'] : ''); hunk ./lib/util.php 1049 + if ($content['id']) { + common_element('input', array('name' => 'reply_id', + 'type' => 'hidden', + 'value' => $content['id'])); + } } Context: [lost the nickname changing from profile to user Evan Prodromou **20080722173613] [add notice sources (currently unused) Evan Prodromou **20080722164639] [correctly return 0 for zero followers Evan Prodromou **20080722164129] [fix content check so it shows zeros Evan Prodromou **20080722163618] [hide magic self subscription Evan Prodromou **20080722163511] [don't get a count anywhere Evan Prodromou **20080722163200] [don't get a count from query Evan Prodromou **20080722163116] [notices and counts Evan Prodromou **20080722162332] [another whitespace SQL error Evan Prodromou **20080722161752] [whitespace in SQL Evan Prodromou **20080722161712] [blow off DB_DataObject joins, write SQL from scratch Evan Prodromou **20080722161549] [centralize and optimize with-friends query Evan Prodromou **20080722160213] [every user is subscribed to themselves Evan Prodromou **20080722144154] [public timeline only gets local notices Evan Prodromou **20080722142050] [mark incoming notices as local or not Evan Prodromou **20080722141828] [mark notices as local Evan Prodromou **20080722141614] [correct values for hidden fields Evan Prodromou **20080721162857] [better confirm cancel Evan Prodromou **20080721162434] [Twitter-compatible API: /help/test was emmitting dupe elements. Fixed. zach@copley.name**20080721091702] [Twitter-compatible API: /friendship/exists always failed - fixed! zach@copley.name**20080720083948] [Twitter-compatible API - refactoring and bug fixes zach@copley.name**20080720083428] [Twitter-compatible API - Error handling that better matches Twitter's zach@copley.name**20080720070905] [Twitter-compatible API: /account/update_location implemented zach@copley.name**20080720044756] [maildaemon enqueues Evan Prodromou **20080721133337] [return true from mail sms broadcast Evan Prodromou **20080721093457] [do the sms query the dumb way Evan Prodromou **20080721093401] [logging and checking Evan Prodromou **20080721092813] [SQL error Evan Prodromou **20080721091854] [fix mail sending Evan Prodromou **20080721090819] [update keys for incomingemail Evan Prodromou **20080721085641] [checkbox named wrong in sms settings Evan Prodromou **20080721084801] [rewrite for settings of sms Evan Prodromou **20080721083758] [some more scrubbing Evan Prodromou **20080721050508] [multitype (???) -> multipart Evan Prodromou **20080721045119] [save changes to smsemail Evan Prodromou **20080721044604] [output with whitespace between lines Evan Prodromou **20080721044135] [explode WHAT, again? Evan Prodromou **20080721044015] [scrub mail content a bit more Evan Prodromou **20080721043734] [trim mail and maildaemon Evan Prodromou **20080721042333] [use smsemail stored value Evan Prodromou **20080721042302] [use user field rather than re-building sms email over and over Evan Prodromou **20080721040614] [add flag for sms replies Evan Prodromou **20080721040551] [add sms email address to user Evan Prodromou **20080721035919] [stop overwriting links.ini Evan Prodromou **20080721035853] [get the correct code Evan Prodromou **20080721012405] [forgot to p Evan Prodromou **20080721012301] [shorter confirmation message and web iface to confirm Evan Prodromou **20080721011128] [fixup autosubscribe save Evan Prodromou **20080720233712] [$true not the same as true Evan Prodromou **20080720233308] [too much merlot on the airplane, dumb syntax mistake Evan Prodromou **20080720202832] [add autosubscribe to profile settings Evan Prodromou **20080720202705] [add autosubscribe Evan Prodromou **20080720201620] [add autosubscribe flag to users Evan Prodromou **20080720200530] [bad string in SQL query Evan Prodromou **20080720200039] [clarify that charges may be exorbitant Evan Prodromou **20080720195834] [add sms broadcast to broadcasting Evan Prodromou **20080720195549] [confirmation for sms Evan Prodromou **20080720193712] [require sms carrier Evan Prodromou **20080720193228] [wrong name for email settings action file Evan Prodromou **20080720193132] [start sms settings Evan Prodromou **20080720193005] [first pass at list of SMS carriers for SMS-to-email gateway Evan Prodromou **20080720053458] [save emailpost flag Evan Prodromou **20080720053431] [email settings for post by email Evan Prodromou **20080719202625] [use mailparse Evan Prodromou **20080719142058] [add a transport flag to queue items Evan Prodromou **20080719140906] [add some logging Evan Prodromou **20080718202702] [pass type to error Evan Prodromou **20080718202124] [better type logic Evan Prodromou **20080718202052] [LOG_ERROR => LOG_ERR in maildaemon Evan Prodromou **20080718191019] [better error msg Evan Prodromou **20080718185027] [fixup error Evan Prodromou **20080718181612] [some missing methods Evan Prodromou **20080718180951] [mailer daemon start Evan Prodromou **20080717132533] [Add hidden form value when the site is not in fancy mode so the action is not lost Mike Cochrane **20080720040351] [Don't highlight search terms inside url Mike Cochrane **20080720033401] [Some more notice errors - I guess I'm the only one developing with E_ALL Mike Cochrane **20080720033236] [A couple more notice errors Mike Cochrane **20080720025546] [Another notice error Mike Cochrane **20080720023510] [Fix a couple of notice errors Mike Cochrane **20080720023259] [Update pot file Mike Cochrane **20080717235306] [correct handling of bareauth Evan Prodromou **20080719171605] [bare auth for friends, too Evan Prodromou **20080719171023] [try again with user_timeline auth Evan Prodromou **20080719155526] [add basic auth for user_timeline Evan Prodromou **20080719154753] [LOG_ERROR -> LOG_ERR Evan Prodromou **20080718190835] [Twitter-compatible API - added missing double quotes to WWW-Authenticate header zach@copley.name**20080718185053] [quote match terms Evan Prodromou **20080718183534] [TAG 0.4.4 Evan Prodromou **20080718164332] Patch bundle hash: 7fd40f94e523b03dbdee882b504e64f2de9cdbd3