]> git.mxchange.org Git - friendica.git/commitdiff
rework autocomplete: don't show the id if contact doesn't have an id
authorrabuzarus <>
Sat, 16 Apr 2016 13:37:34 +0000 (15:37 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 1 May 2016 11:48:52 +0000 (13:48 +0200)
js/autocomplete.js

index dfe0bb3209e2df75f9230950f24938ff3f76cc9f..51e01c6f7e18ad0c1897868a84337168ff0b526c 100644 (file)
@@ -84,7 +84,12 @@ function editor_replace(item) {
 
        // $2 ensures that prefix (@,@!) is preserved
        var id = item.id;
-        // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
+
+       // don't add the id if it is empty (the id empty eg. if there are unknow contacts in thread)
+       if(id.length < 1)
+               return '$1$2' + item.nick;
+
+       // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
        // 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
        if(id.length > 16) 
                id = item.id.substring(0,16);