o3 icon indicating copy to clipboard operation
o3 copied to clipboard

SendGroupTextMessage is not usable

Open akasandra opened this issue 5 years ago • 3 comments

You can't send group text message with current version because this code will never satisfy ok == true:

case o3.GroupTextMessage:
  fmt.Printf("GroupTextMessage: ~%s [%s] for Group [%x] created by [%s]\n", msg.PubNick(), msg.Sender(), msg.GroupID(), msg.GroupCreator())
  fmt.Printf("GroupTextMessage: Text: %s\n", msg.Text())

  group, ok := bot.sc.ID.Groups[msg.GroupCreator()][msg.GroupID()]
  if ok {
  	time.Sleep(500 * time.Millisecond)
  	// respond with a quote of what was send to us. Multiline quote possible.
  	qoute := fmt.Sprintf("> %s: %s\n%s", msg.Sender(), strings.Replace(msg.Text(), "\n", "\n> ", -1), "Exactly in group!")
  	bot.sc.SendGroupTextMessage(group, qoute, bot.sendMsgChan)
  } else {
  	fmt.Printf("ERROR sending to group [%x] by [%s].\n", msg.GroupID(), msg.GroupCreator())
  }

The prototype of this code comes from https://github.com/V-inz/o3demo/blob/testing/main.go#L263 (does not work now)

Searching shows there was also another approach used to find group for this https://github.com/r3ek0/cr3ma/blob/master/main.go (does not work now)

Constructing Group object with o3.Group{GroupID: msg.GroupID(),CreatorID: msg.GroupCreatorID()} does not work - no error is returned, but the message not is not sent/delivered

akasandra avatar Feb 25 '19 10:02 akasandra

Was there ever support for send message to group? Why if i search "Groups" in the source i can only find three lines of code, a map which is never initialized but used in demo code?

akasandra avatar Feb 28 '19 17:02 akasandra

Sorry, I’m not sure about the state of the groups feature set. You might have stumbled into something unfinished.

cryptix avatar Feb 28 '19 22:02 cryptix

I didn’t make it but will let them know about this issue. Might take them a while to get back to you since they are working on other stuff currently and this is unpaid open source after all.

cryptix avatar Mar 01 '19 00:03 cryptix