Skip to content

Commit af669a4

Browse files
committed
Ensure system messages are at beginning of logs created with create_chatlog()
1 parent 7ee8934 commit af669a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/create_chatlog.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ create_chatlog <- function(n_messages = 250,
326326
#### Adding System messages
327327

328328
# sample messages to replace with WhatsApp system messages
329-
sm_rows <- sample(2:n_messages, 50)
329+
# Ensuring that system messages are within the first 200 messages
330+
# so that they are picked up reliably by the excerpt in parse_chat()
331+
sm_rows <- sample(2:200, 50)
330332

331333
# transpose WAStrings for easier handling
332334
WAStrings <- t(WAStrings)
@@ -670,7 +672,6 @@ create_chatlog <- function(n_messages = 250,
670672

671673
WAStrings[42] <- gsub(".*?","Bob",WAStrings[42],fixed = TRUE)
672674

673-
# TODO: FIX THIUS!
674675
WAStrings[43] <- gsub("(?:","",WAStrings[43],fixed = TRUE)
675676
WAStrings[43] <- gsub(")?","",WAStrings[43],fixed = TRUE)
676677
WAStrings[43] <- gsub(".*?","Bob",WAStrings[43],fixed = TRUE)

0 commit comments

Comments
 (0)