mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-11-18 18:07:48 +01:00
added support for '#' in url when not breaking one
and imporved logic for kind 0 processing ( tested with b10 account)
This commit is contained in:
@@ -303,7 +303,7 @@ void printProfile(Store node, String profilePubkey) {
|
|||||||
print("About : $about");
|
print("About : $about");
|
||||||
print("Picture : $picture");
|
print("Picture : $picture");
|
||||||
print("Nip 05 : ${verified?"yes. ${nip05Id}":"no"}");
|
print("Nip 05 : ${verified?"yes. ${nip05Id}":"no"}");
|
||||||
print("Last Updated: ${getPrintableDate(dateLastUpdated)}\n");
|
print("\nLast Updated: ${getPrintableDate(dateLastUpdated)}\n");
|
||||||
|
|
||||||
|
|
||||||
if( profilePubkey != userPublicKey) {
|
if( profilePubkey != userPublicKey) {
|
||||||
|
|||||||
@@ -985,13 +985,12 @@ bool processKind0Event(Event e) {
|
|||||||
|
|
||||||
bool newEntry = false, entryModified = false;
|
bool newEntry = false, entryModified = false;
|
||||||
if( !gKindONames.containsKey(e.eventData.pubkey)) {
|
if( !gKindONames.containsKey(e.eventData.pubkey)) {
|
||||||
gKindONames[e.eventData.pubkey] = UserNameInfo(e.eventData.createdAt, name, about, picture, null);
|
gKindONames[e.eventData.pubkey] = UserNameInfo(e.eventData.createdAt, name, about, picture, e);
|
||||||
newEntry = true;;
|
newEntry = true;;
|
||||||
} else {
|
} else {
|
||||||
int oldTime = gKindONames[e.eventData.pubkey]?.createdAt??0;
|
int oldTime = gKindONames[e.eventData.pubkey]?.createdAt??0;
|
||||||
if( oldTime < e.eventData.createdAt) {
|
if( oldTime < e.eventData.createdAt) {
|
||||||
Event? oldContactEvent = gKindONames[e.eventData.pubkey]?.latestContactEvent;
|
gKindONames[e.eventData.pubkey] = UserNameInfo(e.eventData.createdAt, name, about, picture, e);
|
||||||
gKindONames[e.eventData.pubkey] = UserNameInfo(e.eventData.createdAt, name, about, picture, oldContactEvent);
|
|
||||||
entryModified = true;
|
entryModified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1188,7 +1187,7 @@ String getNumDashes(int num, [String dashType = "-"]) {
|
|||||||
List<List<int>> getUrlRanges(String s) {
|
List<List<int>> getUrlRanges(String s) {
|
||||||
List<List<int>> urlRanges = [];
|
List<List<int>> urlRanges = [];
|
||||||
|
|
||||||
String regexp1 = "http[s]*:\/\/[a-zA-Z0-9]+([.a-zA-Z0-9/_-]*)";
|
String regexp1 = "http[s]*:\/\/[a-zA-Z0-9]+([.a-zA-Z0-9/_\\-\\#]*)";
|
||||||
|
|
||||||
RegExp httpRegExp = RegExp(regexp1);
|
RegExp httpRegExp = RegExp(regexp1);
|
||||||
for( var match in httpRegExp.allMatches(s) ) {
|
for( var match in httpRegExp.allMatches(s) ) {
|
||||||
@@ -1205,12 +1204,9 @@ String makeParagraphAtDepth(String s, int depthInSpaces) {
|
|||||||
|
|
||||||
List<List<int>> urlRanges = getUrlRanges(s);
|
List<List<int>> urlRanges = getUrlRanges(s);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String newString = "";
|
String newString = "";
|
||||||
String spacesString = getNumSpaces(depthInSpaces + gNumLeftMarginSpaces);
|
String spacesString = getNumSpaces(depthInSpaces + gNumLeftMarginSpaces);
|
||||||
|
|
||||||
|
|
||||||
int lenPerLine = gTextWidth - depthInSpaces;
|
int lenPerLine = gTextWidth - depthInSpaces;
|
||||||
//print("In makeParagraphAtDepth: gNumLeftMarginSpaces = $gNumLeftMarginSpaces depthInSPaces = $depthInSpaces LenPerLine = $lenPerLine gTextWidth = $gTextWidth ");
|
//print("In makeParagraphAtDepth: gNumLeftMarginSpaces = $gNumLeftMarginSpaces depthInSPaces = $depthInSpaces LenPerLine = $lenPerLine gTextWidth = $gTextWidth ");
|
||||||
for(int startIndex = 0; startIndex < s.length; ) {
|
for(int startIndex = 0; startIndex < s.length; ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user