-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Change avatar placeholder from single letter to 2 letters #18745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I've extracted avatar creating to private methods because I need a user with different display names for each case. |
With or without imagick? I think it depends on the fonts installed on the os? |
server/lib/private/Avatar/Avatar.php Line 152 in 3f23ace
I think @jancborchardt discussed this at some other issue. The lack of cyrillic / chinese characters was one motivation to use native fonts. Noto Sans seems to support chinese characters. Probably we have to update the font. But that's a different story ;) If you press merge it's the first pr merged for 19 🎉 |
|
@kesselb Seems like some checks failed accidentally. Can't figure out how to re-run it. |
|
Tests failing {
"reqId": "2PvlYgKwiAD5CzA9a6da",
"level": 3,
"time": "2020-01-09T05:27:55+00:00",
"remoteAddr": "127.0.0.1",
"user": "admin",
"app": "no app in context",
"method": "DELETE",
"url": "/ocs/v1.php/cloud/users/user1",
"message": {
"Exception": "Exception",
"Message": "Return value of OC\\Avatar\\Avatar::getAvatarText() must be of the type string, null returned",
"Code": 0,
"Trace": [
{
"file": "/drone/src/lib/private/AppFramework/App.php",
"line": 125,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
},
"deleteUser"
]
},
{
"file": "/drone/src/lib/private/AppFramework/Routing/RouteActionHandler.php",
"line": 47,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Provisioning_API\\Controller\\UsersController",
"deleteUser",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"function": "__invoke",
"class": "OC\\AppFramework\\Routing\\RouteActionHandler",
"type": "->",
"args": [
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"file": "/drone/src/lib/private/Route/Router.php",
"line": 299,
"function": "call_user_func",
"args": [
{
"__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
},
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"file": "/drone/src/ocs/v1.php",
"line": 82,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/ocsapp/cloud/users/user1"
]
}
],
"File": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 109,
"Previous": {
"Exception": "TypeError",
"Message": "Return value of OC\\Avatar\\Avatar::getAvatarText() must be of the type string, null returned",
"Code": 0,
"Trace": [
{
"file": "/drone/src/lib/private/Avatar/Avatar.php",
"line": 173,
"function": "getAvatarText",
"class": "OC\\Avatar\\Avatar",
"type": "->",
"args": []
},
{
"file": "/drone/src/lib/private/Avatar/UserAvatar.php",
"line": 248,
"function": "generateAvatar",
"class": "OC\\Avatar\\Avatar",
"type": "->",
"args": [
"user1",
1024
]
},
{
"file": "/drone/src/lib/private/Avatar/Avatar.php",
"line": 110,
"function": "getFile",
"class": "OC\\Avatar\\UserAvatar",
"type": "->",
"args": [
-1
]
},
{
"file": "/drone/src/lib/private/User/User.php",
"line": 434,
"function": "get",
"class": "OC\\Avatar\\Avatar",
"type": "->",
"args": [
-1
]
},
{
"file": "/drone/src/apps/dav/lib/CardDAV/Converter.php",
"line": 148,
"function": "getAvatarImage",
"class": "OC\\User\\User",
"type": "->",
"args": [
-1
]
},
{
"file": "/drone/src/apps/dav/lib/CardDAV/Converter.php",
"line": 58,
"function": "getAvatarImage",
"class": "OCA\\DAV\\CardDAV\\Converter",
"type": "->",
"args": [
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/apps/dav/lib/CardDAV/SyncService.php",
"line": 278,
"function": "createCardFromUser",
"class": "OCA\\DAV\\CardDAV\\Converter",
"type": "->",
"args": [
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/apps/dav/lib/HookManager.php",
"line": 148,
"function": "updateUser",
"class": "OCA\\DAV\\CardDAV\\SyncService",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/drone/src/lib/private/legacy/hook.php",
"line": 111,
"function": "changeUser",
"class": "OCA\\DAV\\HookManager",
"type": "->",
"args": [
{
"run": true,
"user": "*** sensitive parameter replaced ***",
"feature": "*** sensitive parameter replaced ***",
"value": "*** sensitive parameter replaced ***",
"old_value": "*** sensitive parameter replaced ***"
}
]
},
{
"file": "/drone/src/lib/private/Server.php",
"line": 541,
"function": "emit",
"class": "OC_Hook",
"type": "::",
"args": [
"OC_User",
"changeUser",
{
"run": true,
"user": "*** sensitive parameter replaced ***",
"feature": "*** sensitive parameter replaced ***",
"value": "*** sensitive parameter replaced ***",
"old_value": "*** sensitive parameter replaced ***"
}
]
},
{
"function": "OC\\{closure}",
"class": "OC\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/drone/src/lib/private/Hooks/EmitterTrait.php",
"line": 100,
"function": "call_user_func_array",
"args": [
{
"__class__": "Closure"
},
[
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
]
},
{
"file": "/drone/src/lib/private/Hooks/PublicEmitter.php",
"line": 40,
"function": "emit",
"class": "OC\\Hooks\\BasicEmitter",
"type": "->",
"args": [
"\\OC\\User",
"changeUser",
[
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
]
},
{
"file": "/drone/src/lib/private/User/User.php",
"line": 476,
"function": "emit",
"class": "OC\\Hooks\\PublicEmitter",
"type": "->",
"args": [
"\\OC\\User",
"changeUser",
[
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
]
},
{
"file": "/drone/src/lib/private/Avatar/UserAvatar.php",
"line": 211,
"function": "triggerChange",
"class": "OC\\User\\User",
"type": "->",
"args": [
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/lib/private/Server.php",
"line": 1346,
"function": "remove",
"class": "OC\\Avatar\\UserAvatar",
"type": "->",
"args": []
},
{
"file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 260,
"function": "OC\\{closure}",
"class": "OC\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 235,
"function": "doDispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
}
],
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 73,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
}
],
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/lib/private/EventDispatcher/SymfonyAdapter.php",
"line": 70,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/lib/private/User/User.php",
"line": 203,
"function": "dispatch",
"class": "OC\\EventDispatcher\\SymfonyAdapter",
"type": "->",
"args": [
"*** sensitive parameter replaced ***",
"*** sensitive parameter replaced ***"
]
},
{
"file": "/drone/src/apps/provisioning_api/lib/Controller/UsersController.php",
"line": 658,
"function": "delete",
"class": "OC\\User\\User",
"type": "->",
"args": []
},
{
"file": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
"line": 170,
"function": "deleteUser",
"class": "OCA\\Provisioning_API\\Controller\\UsersController",
"type": "->",
"args": [
"user1"
]
},
{
"file": "/drone/src/lib/private/AppFramework/Http/Dispatcher.php",
"line": 99,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
},
"deleteUser"
]
},
{
"file": "/drone/src/lib/private/AppFramework/App.php",
"line": 125,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Provisioning_API\\Controller\\UsersController"
},
"deleteUser"
]
},
{
"file": "/drone/src/lib/private/AppFramework/Routing/RouteActionHandler.php",
"line": 47,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Provisioning_API\\Controller\\UsersController",
"deleteUser",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"function": "__invoke",
"class": "OC\\AppFramework\\Routing\\RouteActionHandler",
"type": "->",
"args": [
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"file": "/drone/src/lib/private/Route/Router.php",
"line": 299,
"function": "call_user_func",
"args": [
{
"__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
},
{
"userId": "user1",
"_route": "ocs.provisioning_api.Users.deleteUser"
}
]
},
{
"file": "/drone/src/ocs/v1.php",
"line": 82,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/ocsapp/cloud/users/user1"
]
}
],
"File": "/drone/src/lib/private/Avatar/Avatar.php",
"Line": 100
},
"CustomMessage": "--"
},
"userAgent": "GuzzleHttp/6.3.3 curl/7.38.0 PHP/7.3.12-1+0~20191128.49+debian8~1.gbp24559b",
"version": "18.0.0.8"
} |
|
@skjnldsv I've fixed typo but don't understand why a build is failing now. I run tests on a local machine and its passes. |
sometimes tests can timeout or crash :) |
|
@skjnldsv Restart button inactive for me. Could you restart build? Thanks) |
jancborchardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice design wise 👍 great job @matchish!
Thanks) I'm happy to be part of this great community! |
|
Remaining test failures seem unrelated |
|
@juliushaertl You're right. I've restarted tests ten times and tests fail always in different places. |
|
So do we merge this? @skjnldsv want to give it a last look? :) |
|
@matchish please rebase and squash your commits in 1 (or allow us to push to your branch ;) ) |
nextcloud#18717 Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
seems this merge broke the unit tests... |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
|
Is it really necessary to show the auto-generated avatar in mentions? It doesn't really add information in my opinion as the user name is written next to it anyway. |
|
It helps visually to find the mentions e.g. when scrolling through a long chat history, anyway this is not the right place to discuss this. |
|
Also core/src/jquery/avatar.js was not updated and therefor now produces a different avatar then whatever the other method is. |
1- Returns 2 initials instead of 1 (in line with nextcloud/server#18745) 2- Adds supports for unicode-encoded names Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
1- Returns 2 initials instead of 1 (in line with nextcloud/server#18745) 2- Adds supports for unicode-encoded names Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>




#18717
Signed-off-by: Sergey Shliakhov husband.sergey@gmail.com