more basic gm api
This commit is contained in:
parent
9f006b26e2
commit
8346b308c8
50
user.go
50
user.go
@ -254,7 +254,7 @@ func (user *User) Connect() bool {
|
||||
// user.Conn = whatsappExt.ExtendConn(conn)
|
||||
// _ = user.Conn.SetClientName(user.bridge.Config.WhatsApp.OSName, user.bridge.Config.WhatsApp.BrowserName, WAVersion)
|
||||
// user.log.Debugln("WhatsApp connection successful")
|
||||
user.Conn.AddHandler(user)
|
||||
user.Conn.AddFullHandler(user)
|
||||
|
||||
//TODO: typing notification?
|
||||
return user.RestoreSession()
|
||||
@ -889,6 +889,54 @@ func (user *User) HandleJoin(id groupme.ID) {
|
||||
//TODO: efficient
|
||||
}
|
||||
|
||||
func (user *User) HandleGroupName(group groupme.ID, newName string) {
|
||||
//p := user.GetPortalByJID(group.String())
|
||||
//if p != nil {
|
||||
// p.UpdateName(newName, "", false)
|
||||
// get more info abt actual user TODO
|
||||
//}
|
||||
//bugs atm with above?
|
||||
user.HandleChatList()
|
||||
|
||||
}
|
||||
|
||||
func (user *User) HandleGroupTopic(_ groupme.ID, _ string) {
|
||||
user.HandleChatList()
|
||||
}
|
||||
func (user *User) HandleGroupMembership(_ groupme.ID, _ string) {
|
||||
user.HandleChatList()
|
||||
//TODO
|
||||
}
|
||||
|
||||
func (user *User) HandleGroupAvatar(_ groupme.ID, _ string) {
|
||||
user.HandleChatList()
|
||||
}
|
||||
|
||||
func (user *User) HandleLikeIcon(_ groupme.ID, _, _ int, _ string) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
func (user *User) HandleNewNickname(groupID, userID groupme.ID, name string) {
|
||||
puppet := user.bridge.GetPuppetByJID(userID.String())
|
||||
if puppet != nil {
|
||||
puppet.UpdateName(user, user.GetPortalByJID(groupID.String()).MXID, groupme.Member{
|
||||
Nickname: name,
|
||||
UserID: userID,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (user *User) HandleNewAvatarInGroup(groupID, userID groupme.ID, url string) {
|
||||
puppet := user.bridge.GetPuppetByJID(userID.String())
|
||||
if puppet != nil {
|
||||
puppet.UpdateAvatar(user, user.GetPortalByJID(groupID.String()).MXID, url)
|
||||
}
|
||||
}
|
||||
|
||||
func (user *User) HandleMembers(_ groupme.ID, _ []groupme.Member, _ bool) {
|
||||
user.HandleChatList()
|
||||
}
|
||||
|
||||
//func (user *User) HandleImageMessage(message whatsapp.ImageMessage) {
|
||||
// user.messageInput <- PortalMessage{message.Info.RemoteJid, user, message, message.Info.Timestamp}
|
||||
//}
|
||||
|
Loading…
Reference in New Issue
Block a user