MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / getDocumentOwnerAlias

Method getDocumentOwnerAlias

src/database/WizDatabase.cpp:2960–2982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2958}
2959
2960QString WizDatabase::getDocumentOwnerAlias(const WIZDOCUMENTDATA& doc)
2961{
2962 WizDatabase* personDb = personalDatabase();
2963 if (!personDb)
2964 return QString();
2965
2966 QString strUserID = doc.strOwner;
2967
2968 //NOTE: 用户可能使用手机号登录,此时owner为手机号,需要使用昵称
2969 if (!strUserID.contains('@') && strUserID == personDb->getUserId())
2970 {
2971 personDb->getUserDisplayName(strUserID);
2972 }
2973
2974 WIZBIZUSER bizUser;
2975 personDb->userFromID(doc.strKbGUID, strUserID, bizUser);
2976 if (bizUser.alias.isEmpty())
2977 {
2978 int index = strUserID.indexOf('@');
2979 return index == -1 ? strUserID : strUserID.left(index);
2980 }
2981 return bizUser.alias;
2982}
2983
2984bool WizDatabase::getUserName(QString& strUserName)
2985{

Callers 3

setDocumentMethod · 0.80
setDocumentMethod · 0.80
updateInfoListMethod · 0.80

Calls 5

getUserIdMethod · 0.80
getUserDisplayNameMethod · 0.80
userFromIDMethod · 0.80
isEmptyMethod · 0.80
QStringClass · 0.70

Tested by

no test coverage detected