Send images when text is empty regression. (mattermost). Closes #254
This commit is contained in:
		@@ -195,6 +195,7 @@ func (b *Bmattermost) handleMatter() {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		rmsg.Text = text
 | 
							rmsg.Text = text
 | 
				
			||||||
		flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account)
 | 
							flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account)
 | 
				
			||||||
 | 
							flog.Debugf("Message is %#v", rmsg)
 | 
				
			||||||
		b.Remote <- rmsg
 | 
							b.Remote <- rmsg
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -277,6 +277,13 @@ func (m *MMClient) WsReceiver() {
 | 
				
			|||||||
			// check if we didn't empty the message
 | 
								// check if we didn't empty the message
 | 
				
			||||||
			if msg.Text != "" {
 | 
								if msg.Text != "" {
 | 
				
			||||||
				m.MessageChan <- msg
 | 
									m.MessageChan <- msg
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								// if we have file attached but the message is empty, also send it
 | 
				
			||||||
 | 
								if msg.Post != nil {
 | 
				
			||||||
 | 
									if msg.Text != "" || len(msg.Post.FileIds) > 0 {
 | 
				
			||||||
 | 
										m.MessageChan <- msg
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user