mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-03-29 19:21:49 +01:00
added root tag for replies from chat room for kind 1
This commit is contained in:
parent
777de50812
commit
cf8c6a9ff1
@ -150,6 +150,7 @@ class EventData {
|
||||
if( replyId.length > 0) {
|
||||
return replyId;
|
||||
} else {
|
||||
// this is case when there is no reply id . should not actually happen given if conditions
|
||||
if( rootId.length > 0) {
|
||||
return rootId;
|
||||
}
|
||||
|
@ -1157,13 +1157,18 @@ class Store {
|
||||
return;
|
||||
}
|
||||
|
||||
if( eKind == 42 || eKind == 40
|
||||
|| (eKind == 1 && tree.event.eventData.getSpecificTag("location") != null )
|
||||
|| (eKind == 1 && tree.event.eventData.getTTags() != null)){
|
||||
if( eKind == 42 || eKind == 40 ){
|
||||
handleChannelEvents(channels, tempChildEventsMap, tree.event);
|
||||
return;
|
||||
}
|
||||
|
||||
if( (eKind == 1 && tree.event.eventData.getSpecificTag("location") != null )
|
||||
|| (eKind == 1 && tree.event.eventData.getTTags() != null)){
|
||||
handleChannelEvents(channels, tempChildEventsMap, tree.event);
|
||||
// same as above but no return cause these are processed as kind 1 too
|
||||
}
|
||||
|
||||
|
||||
if( eKind == 4) {
|
||||
handleDirectMessage(tempDirectRooms, tempChildEventsMap, tree.event);
|
||||
return;
|
||||
@ -2168,6 +2173,16 @@ class Store {
|
||||
if( pTagPubkey != null) {
|
||||
strTags += ',["p","$pTagPubkey"]';
|
||||
}
|
||||
|
||||
// add root for kind 1 in rooms
|
||||
if( [enumRoomType.RoomLocationTag, enumRoomType.RoomTTag].contains( channel.roomType) ) {
|
||||
Tree? replyTree = allChildEventsMap[latestEventId]??null;
|
||||
if( replyTree != null) {
|
||||
Tree rootTree = getTopTree(replyTree);
|
||||
String rootEventId = rootTree.event.eventData.id;
|
||||
strTags += ',["e","$rootEventId","","root"]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return strTags;
|
||||
|
@ -5,7 +5,7 @@ homepage: https://github.com/vishalxl/nostr_console
|
||||
|
||||
|
||||
# crated location and t rooms
|
||||
# t tags added for all tags
|
||||
# t tags added for all tags
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.3 <3.0.0'
|
||||
|
Loading…
x
Reference in New Issue
Block a user