summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-07-08 21:17:10 +0000
committerZach Copley <zach@status.net>2010-07-08 21:17:11 +0000
commit4c5098cd32599a2c376beaadb43cd9d471477c90 (patch)
tree20ba24a91f86be71fe1e1d079dbd85f0cee90868 /classes
parent7746611f20554c92ad0213de196e880e41c3cc4e (diff)
Handle the case where a screen name has shifted from one Twitter ID to another
Diffstat (limited to 'classes')
-rw-r--r--classes/Foreign_user.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/Foreign_user.php b/classes/Foreign_user.php
index 0dd94ffb9..e98a16064 100644
--- a/classes/Foreign_user.php
+++ b/classes/Foreign_user.php
@@ -39,6 +39,22 @@ class Foreign_user extends Memcached_DataObject
return null;
}
+ static function getByNickname($nickname, $service)
+ {
+ if (empty($nickname) || empty($service)) {
+ return null;
+ } else {
+ $fuser = new Foreign_user();
+ $fuser->service = $service;
+ $fuser->nickname = $nickname;
+ $fuser->limit(1);
+
+ $result = $fuser->find(true);
+
+ return empty($result) ? null : $fuser;
+ }
+ }
+
function updateKeys(&$orig)
{
$this->_connect();