Commit 55d41c5b authored by Randall Leeds's avatar Randall Leeds

Multi-provider user search field

parent c5313dde
...@@ -314,11 +314,12 @@ username = ['$filter', '$window', ($filter, $window) -> ...@@ -314,11 +314,12 @@ username = ['$filter', '$window', ($filter, $window) ->
return unless ctrl? return unless ctrl?
ctrl.$render = -> ctrl.$render = ->
scope.uname = ($filter 'persona') ctrl.$viewValue scope.uname = ($filter 'persona') ctrl.$viewValue, 'username'
scope.provider = ($filter 'persona') ctrl.$viewValue, 'provider'
scope.uclick = (event) -> scope.uclick = (event) ->
event.stopPropagation() event.stopPropagation()
$window.open "/u/" + scope.uname $window.open "/u/#{scope.uname}@#{scope.provider}"
return return
require: '?ngModel' require: '?ngModel'
......
...@@ -107,7 +107,10 @@ class StreamSearch ...@@ -107,7 +107,10 @@ class StreamSearch
rules: rules:
user: user:
formatter: (user) -> formatter: (user) ->
'acct:' + user + '@' + window.location.hostname # FIXME: inject $window
unless '@' in user
user += '@' + window.location.hostname
'acct:' + user
path: '/user' path: '/user'
exact_match: true exact_match: true
case_sensitive: false case_sensitive: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment